Skip to content

Commit

Permalink
ci adjustments
Browse files Browse the repository at this point in the history
* ubuntu:
  * only run jobs for "coverage" and "additional warnings" if the main ci build works
    and use its generated tarball in both cases
  * 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:
  * GMP url changes, building it again for performance reasons
  * building BDB with all relevant patches from MSYS2
  * using msys-build instead of building Bison (only necessary for GC4)
  * drop GC install log step and therefore extra prefix
  * drop extra CFLAGS previously necessary for local cJSON (fixed in 3.x)
    and/or ignoring failing NIST) --> as after last upstream update everything works
  * enable NIST85 (+ comment-code in case we ever need to skip something there
    and/or ignoring failing NIST) --> as after last upstream update everything works
  * 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
  * move env to MSYS job
  • Loading branch information
GitMensch committed Oct 1, 2024
1 parent 61ffca2 commit 07633f9
Show file tree
Hide file tree
Showing 2 changed files with 306 additions and 158 deletions.
82 changes: 57 additions & 25 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ jobs:
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))
# note: distcheck also creates the dist tarball
- name: Build distribution archive & run tests
run: |
Expand All @@ -90,10 +90,10 @@ jobs:
TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite.log
if: ${{ ! cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
if: failure()
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

Expand Down Expand Up @@ -128,6 +128,35 @@ jobs:
_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
strategy:
Expand Down Expand Up @@ -162,25 +191,25 @@ jobs:
--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()
uses: actions/upload-artifact@v4
with:
name: config-${{ matrix.os }}-${{ github.job }}.log
path: _build/config.log

- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
- name: run internal tests
run: |
make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite.log
if: ${{ ! cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite-${{ matrix.os }}-${{ github.job }}.log
path: _build/tests/testsuite.log
Expand All @@ -199,6 +228,7 @@ jobs:
--jobs=$(($(nproc)+1))
- name: Upload NIST85 Test Suite results
if: ${{ ! cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
with:
name: NIST85 results on ${{ matrix.os }}-${{ github.job }}
Expand All @@ -211,24 +241,25 @@ jobs:
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: |
tar -xvf gnucobol*.tar.* --strip-components=1
mkdir _build
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
Expand All @@ -241,20 +272,21 @@ jobs:
run: |
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()
uses: actions/upload-artifact@v4
with:
name: config-${{ matrix.os }}-${{ github.job }}.log
path: _build/config.log

- name: Build
run: |
make -C _build --jobs=$(($(nproc)+1))
- name: Coverage
run: |
# make -C _build check-code-coverage # <- (ignores errors)
Expand All @@ -264,8 +296,8 @@ jobs:
CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
- name: Upload testsuite.log
if: ${{ ! cancelled() }} #-> always upload as build result documentation
uses: actions/upload-artifact@v4
if: failure()
with:
name: testsuite-${{ matrix.os }}-${{ github.job }}.log
path: _build/tests/testsuite.log
Expand Down Expand Up @@ -301,7 +333,7 @@ jobs:
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
Expand Down
Loading

0 comments on commit 07633f9

Please sign in to comment.