Skip to content

Commit

Permalink
ci adjustments
Browse files Browse the repository at this point in the history
* ubuntu:
  * only run coverage and additional warnings when main ci build works - use its generated tarball
  * trigger MSYS1 build, passing the run-id (needs to be adjusted to a "pull" later
* msys1+ubuntu:
  * use "build" instead of "_build"
  * upload config.log after the build - because we may need it to debug build issues
  * always upload the testsuite.log (additional build documentation)
* msys1:
  * drop GC install log and therefore extra prefix
  * building BDB with all relevant patches from MSYS2
  * GMP url changes, building it again for performance reasons
  * using msys-build instead of building Bison (only necessary for GC4)
  * enable NIST85, skipping extra IF106A as this hangs, ignoring failing NIST for now
  * ci cache adjustment:
    * remove split per matrix
    * split per software, enabling smaller updates
  * use CI tarball like for the minimal build
  * drop workflow specific expected failures that now work fine
  • Loading branch information
GitMensch committed Sep 30, 2024
1 parent 61ffca2 commit 8b5c536
Show file tree
Hide file tree
Showing 2 changed files with 330 additions and 181 deletions.
157 changes: 94 additions & 63 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,78 +55,107 @@ jobs:
#
- name: Build environment setup
run: |
mkdir _build
mkdir build
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV
- name: Configure
run: |
cd _build
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
- name: Build
run: |
make -C build --jobs=$(($(nproc)+1))
- name: Upload config.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.os }}-${{ github.job }}.log
path: _build/config.log

- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
path: build/config.log

# note: distcheck also creates the dist tarball
- name: Build distribution archive & run tests
run: |
make -C _build distcheck \
make -C build distcheck \
TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" \
--jobs=$(($(nproc)+1)) || \
make -C _build/gnucobol-$VERSION/_build/sub/tests check \
make -C build/gnucobol-$VERSION/build/sub/tests check \
TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite.log
uses: actions/upload-artifact@v4
if: failure()
# if: failure() -> always upload as build result documentation
with:
# Assume there's only one directory matching `_build/gnucobol-*`:
# Assume there's only one directory matching `build/gnucobol-*`:
name: testsuite-${{ matrix.os }}-${{ github.job }}.log
path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
path: build/gnucobol-${{ env.VERSION }}/build/sub/tests/testsuite.log

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

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

- name: NIST85 Test Suite
run: |
make -C _build/tests/cobol85 EXEC85 test \
make -C build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1))
- name: Upload NIST85 Test Suite results
uses: actions/upload-artifact@v4
with:
name: NIST85 results on ${{ matrix.os }}-${{ github.job }}
path: |
_build/tests/cobol85/summary.*
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out
_build/tests/cobol85/**/duration.txt
build/tests/cobol85/summary.*
build/tests/cobol85/**/*.log
build/tests/cobol85/**/*.out
build/tests/cobol85/**/duration.txt
trigger-more-workflows:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get current workflow run ID
run: echo "RUN_ID=$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Get the Current Branch
id: get_branch
run: |
# If the workflow was triggered by a pull request
if [ "${{ github.event.workflow_run.head_branch }}" ]; then
echo "BRANCH=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_ENV
else
# Extract the branch name from ref (for push events)
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
fi
- name: Trigger additional Workflows via API
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ env.BRANCH }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/windows-msys1.yml/dispatches \
-d '{"ref":"'"$BRANCH"'", "inputs": {"run_id": "'"${{ github.run_id }}"'"}}'
minmal_build:
name: Build and test with minimal dependencies
Expand All @@ -152,84 +181,85 @@ jobs:
- name: Build environment setup
run: |
tar -xvf gnucobol*.tar.* --strip-components=1
mkdir _build
mkdir build
- name: Configure
run: |
cd _build
cd build
../configure --disable-dependency-tracking \
--without-db --without-curses \
--without-xml2 --without-json \
--without-iconv --disable-nls
- name: Build
run: |
make -C build --jobs=$(($(nproc)+1))
- name: Upload config.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.os }}-${{ github.job }}.log
path: _build/config.log

- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
path: build/config.log

- name: run internal tests
run: |
make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
make -C build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C build check TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite.log
uses: actions/upload-artifact@v4
if: failure()
# if: failure() -> always upload as build result documentation
with:
name: testsuite-${{ matrix.os }}-${{ github.job }}.log
path: _build/tests/testsuite.log
path: build/tests/testsuite.log

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

- name: NIST85 Test Suite
run: |
make -C _build/tests/cobol85 EXEC85 test \
make -C build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1))
- name: Upload NIST85 Test Suite results
uses: actions/upload-artifact@v4
with:
name: NIST85 results on ${{ matrix.os }}-${{ github.job }}
path: |
_build/tests/cobol85/summary.*
_build/tests/cobol85/**/*.log
_build/tests/cobol85/**/*.out
_build/tests/cobol85/**/duration.txt
build/tests/cobol85/summary.*
build/tests/cobol85/**/*.log
build/tests/cobol85/**/*.out
build/tests/cobol85/**/duration.txt
coverage:
name: Coverage and Warnings
needs: build
runs-on: ubuntu-latest

steps:
- 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 libdb5.3-dev libxml2-dev libcjson-dev lcov
- name: Bootstrap
run: |
./build_aux/bootstrap
- name: Get CI dist tarball
uses: actions/download-artifact@v4
with:
name: gnucobol-ci source distribution

- name: Build environment setup
run: |
mkdir _build
tar -xvf gnucobol*.tar.* --strip-components=1
mkdir build
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
Expand All @@ -239,72 +269,73 @@ jobs:
# TODO: try and pass -pedantic via CPPFLAGS
- name: Configure
run: |
cd _build
cd build
../configure --enable-code-coverage \
--with-db --with-xml2 --with-json=cjson --with-curses=ncursesw \
CPPFLAGS="-Werror=declaration-after-statement" \
CC="gcc -std=c89"
- name: Build
run: |
make -C build --jobs=$(($(nproc)+1))
- name: Upload config.log
uses: actions/upload-artifact@v4
if: failure()
with:
name: config-${{ matrix.os }}-${{ github.job }}.log
path: _build/config.log

- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
path: build/config.log

- name: Coverage
run: |
# make -C _build check-code-coverage # <- (ignores errors)
make -C _build check \
# 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"
make -C build code-coverage-capture \
CODE_COVERAGE_DIRECTORY="$(realpath .)/build"
- name: Upload testsuite.log
uses: actions/upload-artifact@v4
if: failure()
# if: failure() -> always upload as build result documentation
with:
name: testsuite-${{ matrix.os }}-${{ github.job }}.log
path: _build/tests/testsuite.log
path: build/tests/testsuite.log

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage
path: _build/GnuCOBOL-**-coverage
path: build/GnuCOBOL-**-coverage

- name: Cache newcob.val
uses: actions/cache@v4
with:
path: _build/tests/cobol85/newcob.val
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 \
make -C build/tests/cobol85 EXEC85 test \
--jobs=$(($(nproc)+1)) \
--keep-going
make -C _build code-coverage-capture \
make -C build code-coverage-capture \
CODE_COVERAGE_OUTPUT_DIRECTORY=extended-coverage \
CODE_COVERAGE_OUTPUT_FILE=extended-coverage.info \
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
CODE_COVERAGE_DIRECTORY="$(realpath .)/build"
- name: Upload extended coverage report
uses: actions/upload-artifact@v4
with:
name: extended-coverage
path: _build/extended-coverage
path: build/extended-coverage

- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: _build
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 8b5c536

Please sign in to comment.