Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI adjustments for gcos4gnucobol-3.x #170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 29 additions & 37 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches: [ gcos4gnucobol-3.x ]
push:
branches: [ gcos4gnucobol-3.x ]
# manual run in actions tab - for all branches
workflow_dispatch:

Expand All @@ -14,7 +13,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
# - macos-latest-large # macos 14, amd64
- macos-latest # macos 14, arm64

runs-on: ${{ matrix.os }}

Expand All @@ -24,7 +24,7 @@ jobs:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install packages
run: |
Expand All @@ -41,9 +41,7 @@ jobs:

- name: bootstrap
run: |
./autogen.sh
autoconf
autoreconf --install --force
./build_aux/bootstrap install

- name: Build environment setup
run: |
Expand All @@ -55,62 +53,56 @@ jobs:
- name: configure
run: |
cd _build
../configure --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol-gcos --exec-prefix /opt/cobol/gnucobol-gcos
../configure --enable-cobc-internal-checks \
--enable-hardening \
--prefix /opt/cobol/gnucobol-gcos \

- name: Upload config.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: config.log
name: config-${{ matrix.os }}.log
path: _build/config.log
if: failure()

- name: make
run: |
cd _build
make --jobs=$((${NPROC}+1))
make -C _build --jobs=$((${NPROC}+1))

# make install must be done before make check, otherwise execution of
# generated COBOL files fail for a missing /usr/local/lib/libcob.dylib
# make install must be done before make check, otherwise
# execution of generated COBOL files fail for a missing
# /usr/local/lib/libcob.dylib
- name: make install
run: |
cd _build
sudo make install
find /opt/cobol > install.log
sudo make -C _build install
find /opt/cobol > _build/install.log

- name: Upload install.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: install.log
name: install-${{ matrix.os }}.log
path: _build/install.log

- name: check
run: |
cd _build
make check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
make -C _build check \
TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"

- name: Upload testsuite.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite.log
name: testsuite-${{ matrix.os }}.log
path: _build/tests/testsuite.log

- name: Cache newcob.val.Z
uses: actions/cache@v3
id: newcob
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val.Z.cached
key: newcob

- name: Download newcob.val.Z
if: steps.newcob.outputs.cache-hit != 'true'
run: |
cd _build/tests/cobol85
make newcob.val.Z
ln -f newcob.val.Z newcob.val.Z.cached
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true

- name: NIST85 Test Suite
run: |
cd _build/tests/cobol85
ln -f newcob.val.Z.cached newcob.val.Z
make EXEC85 && make --jobs=$(($(nproc)+1)) test
make -C _build/tests/cobol85 EXEC85 test \
--jobs=$((${NPROC}+1))
163 changes: 92 additions & 71 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches: [ gcos4gnucobol-3.x ]
push:
branches: [ gcos4gnucobol-3.x ]
nberth marked this conversation as resolved.
Show resolved Hide resolved
# manual run in actions tab - for all branches
workflow_dispatch:

Expand All @@ -14,30 +13,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
include:
- os: ubuntu-latest
skip_test: true

os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev libcjson-dev bison flex help2man gettext texlive
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev libcjson-dev \
bison flex help2man gettext texlive

- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email github-actions-bot@users.noreply.github.com

- name: bootstrap
- name: Bootstrap
run: |
./build_aux/bootstrap

Expand All @@ -62,97 +57,88 @@ jobs:
echo "TERM=$TERM" >> $GITHUB_ENV
echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV

- name: configure
- name: Configure
run: |
cd _build
../configure --enable-cobc-internal-checks --enable-hardening --prefix ${INSTALL_PATH}
echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV
../configure --enable-cobc-internal-checks \
--enable-hardening \
--prefix ${INSTALL_PATH}
echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" \
>> $GITHUB_ENV

- name: Upload config.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: config.log
name: config-${{ matrix.os }}.log
path: _build/config.log

- name: make
- name: Build
run: |
cd _build
make --jobs=$(($(nproc)+1))

# - name: check
# run: |
# cd _build
# make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
make -C _build --jobs=$(($(nproc)+1))

# note: distcheck also creates the dist tarball
- name: distcheck
- name: Build distribution archive & run tests
run: |
cd _build
make --jobs=$(($(nproc)+1)) distcheck TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
make -C _build distcheck \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" \
--jobs=$(($(nproc)+1)) || \
make -C _build/gnucobol-$VERSION/_build/sub/tests check \
TESTSUITEFLAGS="--recheck --verbose"

- name: Upload testsuite.log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
# Assume there's only one directory matching `_build/gnucobol-*`:
name: testsuite.log
name: testsuite-${{ matrix.os }}.log
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log

- name: Upload dist tarball
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: gnucobol-ci source distribution
path: _build/gnucobol*.tar*
if-no-files-found: error
retention-days: 0

- name: Cache newcob.val.Z
uses: actions/cache@v3
id: newcob
- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val.Z.cached
key: newcob

- name: Download newcob.val.Z
if: steps.newcob.outputs.cache-hit != 'true'
run: |
cd _build/tests/cobol85
make newcob.val.Z
ln -f newcob.val.Z newcob.val.Z.cached
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true

- name: NIST85 Test Suite
run: |
cd _build/tests/cobol85
ln -f newcob.val.Z.cached newcob.val.Z
make EXEC85 && make --jobs=$(($(nproc)+1)) test
make -C _build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1))

- uses: actions/upload-artifact@v3
- name: Upload NIST85 Test Suite results
uses: actions/upload-artifact@v4
with:
name: NIST85 results
name: NIST85 results on ${{ matrix.os }}
path: |
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out

- name: install
run: |
cd _build
make install


coverage:
name: Coverage and Warnings
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

# note: less dependencies as we don't generate a dist tarball, one additional for lcov
- name: Install dependencies
run: |
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev libcjson-dev bison flex help2man gettext lcov
sudo apt-get install automake libtool libdb5.3-dev libxml2-dev \
libcjson-dev bison flex help2man gettext lcov

- name: bootstrap
- name: Bootstrap
run: |
./build_aux/bootstrap

Expand All @@ -162,40 +148,75 @@ jobs:
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV

# note: w add additional C compiler syntax checks here to not need _another_ CI run
- name: configure
# note: add additional C compiler syntax checks here to not need
# _another_ CI run
#
# TODO: try and pass -pedantic via CPPFLAGS
- name: Configure
run: |
cd _build
../configure --enable-code-coverage CPPFLAGS="-Werror=declaration-after-statement"
../configure --enable-code-coverage \
nberth marked this conversation as resolved.
Show resolved Hide resolved
CPPFLAGS="-Werror=declaration-after-statement" \
CC="gcc -std=c89"

- uses: actions/upload-artifact@v3
- name: Upload config.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config.log
name: config-${{ matrix.os }}.log
path: _build/config.log

- name: make
- name: Build
run: |
cd _build
make --jobs=$(($(nproc)+1))
make -C _build --jobs=$(($(nproc)+1))

- name: coverage
- name: Coverage
run: |
cd _build
make check-code-coverage TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
# make -C _build check-code-coverage # <- (ignores errors)
make -C _build check \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))"
make -C _build code-coverage-capture \
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"

- uses: actions/upload-artifact@v3
- name: Upload testsuite.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite.log
name: testsuite-${{ matrix.os }}.log
path: _build/tests/testsuite.log

- uses: actions/upload-artifact@v3
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: _build/GnuCOBOL-**-coverage

- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
key: newcob-val
save-always: true
enableCrossOsArchive: true

- name: Extended coverage
run: |
make -C _build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1)) \
--keep-going
make -C _build code-coverage-capture \
CODE_COVERAGE_OUTPUT_DIRECTORY=extended-coverage \
CODE_COVERAGE_OUTPUT_FILE=extended-coverage.info \
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"

- name: Upload extended coverage report
uses: actions/upload-artifact@v4
with:
name: coverage
path: _build/GnuCOBOL-**-coverage/
name: extended-coverage-${{ matrix.os }}
path: _build/extended-coverage

- uses: codecov/codecov-action@v2
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: _build
Expand Down
Loading
Loading