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
  * add two new artifacts: test binaries and windows source
* ubuntu+msys1+msys2+macos:
  * upload config.log after the build - because we may need it to debug build issues
  * always upload the testsuite.log (additional build documentation)
* ubuntu+msys1+msys2:
  * use --with-pkgversion to mark CI binaries
* msys2+macos:
  * uploading NIST test results
* msys1:
  * GMP url changes, building it again for performance reasons
  * building BDB with all relevant patches from MSYS2
  * drop GC install log step and therefore extra prefix
  * using msys-build instead of building Bison (only necessary for GC4)
  * drop extra CFLAGS previously necessary for local cJSON (fixed in 3.x)
  * 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 flex+bison
  * drop workflow specific expected failures that now work fine
  * move env to MSYS job
  * resolve env vars by build API instead of runner
* integrate msys1.yml into ubuntu.yml, renaming to build_nightly.yml
* msys2:
  * split NIST + internal testsuite and run the later with less jobs to prevent hanging
  * split between "prepare" and "build" job, with the former generating a full distribution
    inclusive documentation, and the later having less packages installed,
    allowing to enable i386 again
  * disable BDB for 32bit build as MSYS2 doesn't provide that any more
  * switch cjson to json-c (more commonly used, MSYS2 still providing 32bit build)
  * explicit list of dependencies for configure
* msvc:
  * testsuite skip adjustments from the generated testsuite
  * enable building binary package and artifact
  * export dependencies and artifact

(cherry picked from commit 7d4a2fd)
  • Loading branch information
GitMensch committed Oct 7, 2024
1 parent 11dd7df commit 95f8be6
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 79 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build, Test and provide Nightly (Ubuntu + MSYS1)

on:

pull_request:
branches: [ gc4 ]
push:
#pull_request:
# branches: [ gc4 ]
#push:
# manual run in actions tab - for all branches
workflow_dispatch:

Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
# M4: m4
MSYSTEM: MINGW32
MSYSPKGS: msys-m4 msys-coreutils msys-patch
#MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man msys-bison msys-patch GC3 from VCS
#MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man msys-bison msys-patch GC4 from VCS
#MINGW_AUTOCONF_VERS: 2.7.0 # only needed to build from VCS, not from dist tarball
#MINGW_BISON_VERS: bison-3.6 # minimal for GC 4.x+
MINGW_GMP_VERS: gmp-6.3.0 # always update for performance reasons
Expand Down Expand Up @@ -602,10 +602,15 @@ jobs:


- name: get cJSON
shell: cmd
run: |
curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v${{ env.MINGW_CJSON_VERS }}/cJSON.c -o .\libcob\cJSON.c
curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v${{ env.MINGW_CJSON_VERS }}/cJSON.h -o .\libcob\cJSON.h
rem to be dropped after merging the adjustment in configure.ac
mkdir _build\libcob
copy .\libcob\cJSON.* _build\libcob\
# - name: Bootstrap GnuCOBOL
# run: |
Expand Down Expand Up @@ -664,6 +669,7 @@ jobs:
- name: Run testsuite
shell: cmd
continue-on-error: true # dirty approach until merging leads to less errors (currently 18!) is finished
run: |
rem skip test as it sometimes works and sometimes not...
rem instead of
Expand All @@ -680,7 +686,7 @@ jobs:
rem to work around regular hangs we run NIST first, then the internal
rem and the later only with 2 jobs
bash -lc "CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--jobs=2\""
bash -lc "CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--jobs=2\" || CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--recheck --verbose\""
rem Note: the extra CPATH above is only required in debug builds (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
- name: Upload testsuite-${{ matrix.target }}.log
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: MacOS Workflow 4

on:
pull_request:
branches: [ gc4 ]
#pull_request:
# branches: [ gc4 ]
push:
# manual run in actions tab - for all branches
workflow_dispatch:
Expand Down Expand Up @@ -59,21 +59,21 @@ jobs:
- name: Build environment setup
run: |
mkdir _build
echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
export TERM="vt100"
echo "TERM=$TERM" >> $GITHUB_ENV
- name: configure
run: |
mkdir _build
cd _build
../configure --with-${{ matrix.isam }} \
--with-indexed=${{ matrix.isam }} \
--enable-cobc-internal-checks \
--enable-hardening \
--prefix /opt/cobol/gnucobol4-gcos \
CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality" \
CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH"
--prefix /opt/cobol/gnucobol4 \
CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS" \
CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
- name: make
run: |
Expand Down Expand Up @@ -106,13 +106,19 @@ jobs:
# instead of
# sed -i '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
# use
sed -i '/run_file/{N;/INDEXED file SUPPRESS WHEN ALL/{N;N;N;N;s/traceon/traceon; echo "workflow:1">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
sed -i '/run_file/{N;/EXTFH: using ISAM callback/{N;N;N;N;s/traceon/traceon; echo "workflow:2">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
sed -i '/run_file/{N;/"trace feature"/{N;N;N;N;s/traceon/traceon; echo "workflow:3">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
sed -i '/run_file/{N;/trace feature with subroutine/{N;N;N;N;s/traceon/traceon; echo "workflow:4">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
sed -i '/run_file/{N;/trace feature with indexed EXTFH/{N;N;N;N;s/traceon/traceon; echo "workflow:5">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
#sed -i '' '/run_file/{N;/INDEXED file SUPPRESS WHEN ALL/{N;N;N;N;s/traceon/traceon; echo "workflow:1">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
#sed -i '' '/run_file/{N;/trace feature/{N;N;N;N;s/traceon/traceon; echo "workflow:3">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
#sed -i '' '/run_file/{N;/trace feature with subroutine/{N;N;N;N;s/traceon/traceon; echo "workflow:4">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
#sed -i '' '/run_file/{N;/trace feature with indexed EXTFH/{N;N;N;N;s/traceon/traceon; echo "workflow:5">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
#sed -i '' '/run_file/{N;/EXTFH: using ISAM callback/{N;N;N;N;s/traceon/traceon; echo "workflow:2">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
#sed -i '' '/run_file/{N;/EXTFH: using ISAM callback/{N;N;N;N;s/traceon/traceon; echo "workflow:2">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
sed -i '' '/run_file/{N;/INDEXED file SUPPRESS WHEN ALL/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
sed -i '' '/run_file/{N;/EXTFH: using ISAM callback/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
# marks all of those as expected failures
sed -i '' '/run_file/{N;/trace feature/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \
make -C _build check TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
uses: actions/upload-artifact@v4
Expand All @@ -129,11 +135,6 @@ jobs:
save-always: true
enableCrossOsArchive: true

# - name: NIST85 Test Suite
# run: |
# make -C _build/tests/cobol85 EXEC85 test \
# --jobs=$((${NPROC}+1))

- name: Run NIST85 testsuite
run: |
make -C _build/tests test --jobs=$((${NPROC}+1))
Expand Down
81 changes: 30 additions & 51 deletions .github/workflows/windows-msvc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Windows MSVC (build only)
name: Windows MSVC

on:
pull_request:
branches: [ gc4 ]
#pull_request:
# branches: [ gc4 ]
push:
# manual run in actions tab - for all branches
workflow_dispatch:
Expand Down Expand Up @@ -44,10 +44,10 @@ jobs:

steps:

- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
# - name: Set git user
# run: |
# git config --global user.name github-actions
# git config --global user.email [email protected]

- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -151,44 +151,6 @@ jobs:
run: |
pacman --needed --noconfirm -S $MSYSPKGS
- name: Adjust testsuite
shell: C:\shells\msys2bash.cmd {0}
run: |
cd tests
sed -i '/AT_SETUP(\[Compare FLOAT-LONG with floating-point literal\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
sed -i '/AT_SETUP(\[Numeric operations (3) PACKED-DECIMAL\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
sed -i '/AT_SETUP(\[Numeric operations (7)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
sed -i '/AT_SETUP(\[integer arithmetic on floating-point var\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
sed -i '/AT_SETUP(\[FLOAT-DECIMAL w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
sed -i '/AT_SETUP(\[FLOAT-SHORT \/ FLOAT-LONG w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
sed -i '/AT_SETUP(\[FLOAT-LONG with SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
sed -i '/AT_SETUP(\[FUNCTION ANNUITY\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
sed -i '/AT_SETUP(\[FUNCTION INTEGER\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
sed -i '/AT_SETUP(\[FUNCTION MOD (valid)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
sed -i '/AT_SETUP(\[FUNCTION SECONDS-FROM-FORMATTED-TIME\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
sed -i '/AT_SETUP(\[GCOS floating-point usages\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_extensions.at
sed -i '/AT_SETUP(\[BINARY: 64bit unsigned arithmetic notrunc\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_binary.at
sed -i '/AT_SETUP(\[DISPLAY: ADD and SUBTRACT w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_display.at
sed -i '/AT_SETUP(\[DISPLAY: ADD and SUBTRACT, all ROUNDED MODEs\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_display.at
sed -i '/AT_SETUP(\[BCD ADD and SUBTRACT w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_packed.at
sed -i '/AT_SETUP(\[BCD ADD and SUBTRACT, all ROUNDED MODEs\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_packed.at
sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at
# Skip two tests that behave differently (fail or hand) under MSVC Debug
# - System routine CBL_GC_HOSTED: fails because libcob is linked with the debug version
# of the C runtime while the generated module is linked with the release version
# - PROGRAM COLLATING SEQUENCE: fails because of a data loss in a cast, due
# to lack of specific handling of LOW/HIGH-VALUE for NATIONAL alphabets
# (see typeck.c:cb_validate_collating)
- name: Adjust testsuite for Debug target
if: ${{ matrix.target == 'Debug' }}
shell: C:\shells\msys2bash.cmd {0}
run: |
cd tests
sed -i '/AT_SETUP(\[System routine CBL_GC_HOSTED\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_extensions.at
sed -i '/AT_SETUP(\[PROGRAM COLLATING SEQUENCE\])/a AT_SKIP_IF(\[true\])' testsuite.src/syn_definition.at
- name: Build testsuite
shell: C:\shells\msys2bash.cmd {0}
run: |
Expand Down Expand Up @@ -216,6 +178,24 @@ jobs:
# sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
sed -i '/run_misc/{N;/write to internal storage (1)/{N;N;N;N;s/traceon/traceon; echo "workflow:1">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_fundamental/{N;/Compare FLOAT-LONG with floating-point litera/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_fundamental/{N;/Numeric operations (3) PACKED-DECIMAL/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_fundamental/{N;/Numeric operations (7)/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_fundamental/{N;/integer arithmetic on floating-point var/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_misc/{N;/FLOAT-DECIMAL w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_misc/{N;/FLOAT-SHORT \/ FLOAT-LONG w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_misc/{N;/FLOAT-LONG with SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_functions/{N;/FUNCTION ANNUITY/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_functions/{N;/FUNCTION INTEGER/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_functions/{N;/FUNCTION MOD (valid)/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_functions/{N;/FUNCTION SECONDS-FROM-FORMATTED-TIME/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/run_extensions/{N;/GCOS floating-point usages/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/data_binary/{N;/BINARY: 64bit unsigned arithmetic notrunc/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/data_display/{N;/DISPLAY: ADD and SUBTRACT w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/data_display/{N;/DISPLAY: ADD and SUBTRACT, all ROUNDED MODEs/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/data_packed/{N;/BCD ADD and SUBTRACT w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# sed -i '/data_packed/{N;/BCD ADD and SUBTRACT, all ROUNDED MODEs/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
# Fail two tests that behave differently under MSVC Debug
# - System routine CBL_GC_HOSTED: fails because libcob is linked with the debug version
# of the C runtime while the generated module is linked with the release version
Expand All @@ -226,20 +206,19 @@ jobs:
if: ${{ matrix.target == 'Debug' }}
shell: C:\shells\msys2bash.cmd {0}
run: |
#sed -i '/run_extensions/{N;/System routine CBL_GC_HOSTED/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
#sed -i '/syn_definition/{N;/PROGRAM COLLATING SEQUENCE/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
sed -i '/run_extensions/{N;/System routine CBL_GC_HOSTED/{N;s/at_xfail=no/at_xfail=yes/;}}' tests/testsuite
sed -i '/syn_definition/{N;/PROGRAM COLLATING SEQUENCE/{N;s/at_xfail=no/at_xfail=yes/;}}' tests/testsuite
- name: Run testsuite
continue-on-error: true
#continue-on-error: true
run: |
set CL=/I "${{ env.VCPKG_ROOT }}\installed\${{ matrix.arch }}-windows\include"
call "%VCVARS%"
pushd ..\bin
cobc -x gcdiff.c
popd
set MSYS2_PATH_TYPE=inherit
cd tests
C:\shells\msys2bash.cmd -c "./testsuite || ./testsuite --recheck --verbose"
C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && cd ../bin && cobc -v -x gcdiff.c"
C:\shells\msys2bash.cmd -c "./testsuite --jobs=2 || ./testsuite --recheck --verbose"
- name: Upload testsuite-${{ matrix.arch }}-${{ matrix.target }}.log
uses: actions/upload-artifact@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/windows-msys2.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Windows MSYS2 (build only)
name: Windows MSYS2

on:
pull_request:
branches: [ gc4 ]
push:
#pull_request:
# branches: [ gc4 ]
#push:
# manual run in actions tab - for all branches
workflow_dispatch:

Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
# and the later only with 2 jobs
# make -C _build/tests checkall TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
make -C _build/tests check TESTSUITEFLAGS="--jobs=2" || \
make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
- name: Upload testsuite-${{matrix.sys}}-${{matrix.target}}.log
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 95f8be6

Please sign in to comment.