Skip to content

Commit

Permalink
Update CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Sep 2, 2024
1 parent deb74ac commit 201e4c0
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 161 deletions.
64 changes: 29 additions & 35 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: [ gc4 ]
push:
branches: [ gc4 ]
# 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
isam:
- db
- visam
Expand Down Expand Up @@ -60,9 +60,7 @@ jobs:
- name: bootstrap
run: |
sed -i '' 's/-undefined suppress//g' configure.ac
./autogen.sh
autoconf
autoreconf --install --force
./build_aux/bootstrap install
- name: Build environment setup
run: |
Expand All @@ -76,32 +74,35 @@ jobs:
cd _build
export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
export CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS"
../configure --with-${{ matrix.isam }} --with-indexed=${{ matrix.isam }} --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol
../configure --with-${{ matrix.isam }} \
--with-indexed=${{ matrix.isam }} \
--enable-cobc-internal-checks \
--enable-hardening \
--prefix /opt/cobol/gnucobol
- name: Upload config-${{ matrix.isam }}.log
- name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.isam }}.log
name: config-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/config.log

- 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, otherwis
# 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-${{ matrix.isam }}.log
- name: Upload install-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
with:
name: install-${{ matrix.isam }}.log
name: install-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/install.log

- name: check
Expand All @@ -116,32 +117,25 @@ jobs:
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a\
AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
cd _build
make check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
make -C _build check \
TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
- name: Upload testsuite-${{ matrix.isam }}.log
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite-${{ matrix.isam }}.log
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/tests/testsuite.log

- name: Cache newcob.val.Z
- name: Cache newcob.val
uses: actions/cache@v4
id: newcob
with:
path: _build/tests/cobol85/newcob.val.Z.cached
key: newcob-${{ matrix.isam }}

- 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))
156 changes: 90 additions & 66 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: [ gc4 ]
push:
branches: [ gc4 ]
# manual run in actions tab - for all branches
workflow_dispatch:

Expand All @@ -19,9 +18,6 @@ jobs:
isam:
- db
- visam
include:
- os: ubuntu-latest
skip_test: true

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

Expand All @@ -38,7 +34,8 @@ jobs:
- 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: Installing VISAM prerequisite
if: ${{ matrix.isam == 'visam' }}
Expand All @@ -53,7 +50,7 @@ jobs:
echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
- name: bootstrap
- name: Bootstrap
run: |
./build_aux/bootstrap
Expand All @@ -78,41 +75,43 @@ jobs:
echo "TERM=$TERM" >> $GITHUB_ENV
echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV
- name: configure
- name: Configure
run: |
cd _build
../configure --with-${{ matrix.isam }} --with-indexed=${{ matrix.isam }} --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-${{ matrix.isam }}.log
../configure --with-${{ matrix.isam }} \
--with-indexed=${{ matrix.isam }} \
--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-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.isam }}.log
name: config-${{ matrix.os }}-${{ matrix.isam }}.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-${{ matrix.isam }}.log
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
# Assume there's only one directory matching `_build/gnucobol-*`:
name: testsuite-${{ matrix.isam }}.log
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log

- name: Upload dist tarball
Expand All @@ -123,52 +122,43 @@ jobs:
if-no-files-found: error
retention-days: 0

- name: Cache newcob.val.Z
- name: Cache newcob.val
uses: actions/cache@v4
id: newcob
with:
path: _build/tests/cobol85/newcob.val.Z.cached
key: newcob-${{ matrix.isam }}

- 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@v4
- name: Upload NIST85 Test Suite results
uses: actions/upload-artifact@v4
with:
name: NIST85 results (${{ matrix.isam }})
name: NIST85 results on ${{ matrix.os }} (${{ matrix.isam }})
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@v4
- 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 @@ -178,44 +168,78 @@ 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: w 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 \
CPPFLAGS="-Werror=declaration-after-statement" \
CC="gcc -std=c89"
- uses: actions/upload-artifact@v4
- name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config.log
name: config-${{ matrix.os }}-${{ matrix.isam }}.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@v4
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite.log
name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
path: _build/tests/testsuite.log

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

- uses: codecov/codecov-action@v2
- 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: extended-coverage-${{ matrix.os }}-${{ matrix.isam }}
path: _build/extended-coverage

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: _build
# Shall fail until we have a working account on codecov.io
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)

Loading

0 comments on commit 201e4c0

Please sign in to comment.