diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b89faad17..dd65c1592 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,7 +4,6 @@ on: pull_request: branches: [ gc4 ] push: - branches: [ gc4 ] # manual run in actions tab - for all branches workflow_dispatch: @@ -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 @@ -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: | @@ -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 @@ -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)) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ded64ce29..b2128280c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,7 +4,6 @@ on: pull_request: branches: [ gc4 ] push: - branches: [ gc4 ] # manual run in actions tab - for all branches workflow_dispatch: @@ -19,9 +18,6 @@ jobs: isam: - db - visam - include: - - os: ubuntu-latest - skip_test: true runs-on: ${{ matrix.os }} @@ -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' }} @@ -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 @@ -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 @@ -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 @@ -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) - diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml index 9b7778038..26e5dcf03 100644 --- a/.github/workflows/windows-msvc.yml +++ b/.github/workflows/windows-msvc.yml @@ -4,7 +4,6 @@ on: pull_request: branches: [ gc4 ] push: - branches: [ gc4 ] # manual run in actions tab - for all branches workflow_dispatch: @@ -46,6 +45,7 @@ jobs: - Release runs-on: ${{ matrix.os }} + timeout-minutes: 45 steps: @@ -162,20 +162,6 @@ jobs: cd tests sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at - - name: Adjust testsuite for Debug target - if: ${{ matrix.target == 'Debug' }} - shell: C:\shells\msys2bash.cmd {0} - run: | - cd tests - sed -i '/AT_SETUP(\[ASSIGN DYNAMIC with data item in LINKAGE\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_file.at - sed -i '/AT_SETUP(\[SEQUENTIAL basic I\/O\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_file.at - sed -i '/AT_SETUP(\[EXTERNAL RELATIVE file])/a AT_SKIP_IF(\[true\])' testsuite.src/run_file.at - sed -i '/AT_SETUP(\[LINE SEQUENTIAL one Record])/a AT_SKIP_IF(\[true\])' testsuite.src/run_file.at - sed -i '/AT_SETUP(\[Concatenated Files])/a AT_SKIP_IF(\[true\])' testsuite.src/run_file.at - sed -i '/AT_SETUP(\[FUNCTION RANDOM])/a AT_SKIP_IF(\[true\])' testsuite.src/run_functions.at - -# The tests in sed commands above randomly hang (under debug configurations) - - name: Build testsuite shell: C:\shells\msys2bash.cmd {0} run: | diff --git a/.github/workflows/windows-msys1.yml b/.github/workflows/windows-msys1.yml index ef8a2ecbf..120f51b48 100644 --- a/.github/workflows/windows-msys1.yml +++ b/.github/workflows/windows-msys1.yml @@ -4,7 +4,6 @@ on: pull_request: branches: [ gc4 ] push: - branches: [ gc4 ] # manual run in actions tab - for all branches workflow_dispatch: @@ -45,6 +44,7 @@ jobs: - release runs-on: ${{ matrix.os }} + timeout-minutes: 45 steps: @@ -96,7 +96,7 @@ jobs: bash -lc "cd %MINGW_BISON_VERS% && ./configure --prefix=/mingw && make" bash -lc "cd %MINGW_BISON_VERS% && make install" - # Note: actually unavailable, so skip (works with the GMP alredy provided) + # Note: actually unavailable, so skip (works with the GMP already provided) # - name: Install GMP # if: steps.restore-msys.outputs.cache-hit != 'true' # run: | diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml index de84a65a5..52ef7dd9d 100644 --- a/.github/workflows/windows-msys2.yml +++ b/.github/workflows/windows-msys2.yml @@ -4,7 +4,6 @@ on: pull_request: branches: [ gc4 ] push: - branches: [ gc4 ] # manual run in actions tab - for all branches workflow_dispatch: @@ -13,17 +12,15 @@ jobs: strategy: fail-fast: false matrix: - os: - - windows-latest - isam: - - db # Purely informative - arch: - - x64 # Purely informative - target: - - debug - - release + include: + - { os: windows-latest, isam: db, target: release, sys: mingw64, env: x86_64 } + - { os: windows-latest, isam: db, target: debug, sys: mingw64, env: x86_64 } + - { os: windows-latest, isam: db, target: debug, sys: ucrt64, env: ucrt-x86_64 } + - { os: windows-latest, isam: db, target: debug, sys: clang64, env: clang-x86_64 } + # - { target: debug, sys: mingw32, env: i686 } runs-on: ${{ matrix.os }} + timeout-minutes: 45 steps: @@ -46,19 +43,24 @@ jobs: echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV } - - name: Install MSYS2 packages + - name: Install packages uses: msys2/setup-msys2@v2 with: update: true - msystem: ucrt64 - install: autoconf automake libtool make mingw-w64-ucrt-x86_64-ncurses mingw-w64-ucrt-x86_64-libxml2 mingw-w64-ucrt-x86_64-cjson mingw-w64-ucrt-x86_64-db mingw-w64-ucrt-x86_64-gmp libdb-devel mingw-w64-ucrt-x86_64-gcc flex bison gmp-devel help2man texinfo gettext-devel + msystem: ${{matrix.sys}} + install: autoconf automake libtool make flex bison help2man texinfo + mingw-w64-${{matrix.env}}-cc + mingw-w64-${{matrix.env}}-gmp gmp-devel + mingw-w64-${{matrix.env}}-gettext-runtime gettext-devel + mingw-w64-${{matrix.env}}-ncurses + mingw-w64-${{matrix.env}}-libxml2 + mingw-w64-${{matrix.env}}-cjson + mingw-w64-${{matrix.env}}-db libdb-devel - name: Bootstrap GnuCOBOL shell: msys2 {0} run: | - ./autogen.sh - autoconf - autoreconf --install --force + ./build_aux/bootstrap install - name: Configure GnuCOBOL shell: msys2 {0} @@ -67,56 +69,60 @@ jobs: cd _build ../configure $CFGOPT --with-db --with-indexed=db --prefix=/opt/cobol/gnucobol - - name: Upload config-${{ matrix.target }}.log + - name: Upload config-${{matrix.sys}}-${{matrix.target}}.log uses: actions/upload-artifact@v4 if: failure() with: - name: config-${{ matrix.target }}.log + name: config-${{matrix.sys}}-${{matrix.target}}.log path: ${{ env.GITHUB_WORKSPACE }}/_build/config.log - name: Build GnuCOBOL shell: msys2 {0} run: | - cd _build - make --jobs=$(($(nproc)+1)) - - - name: Install GnuCOBOL - shell: msys2 {0} - run: | - cd _build - make install - find /opt/cobol > install.log + make -C _build --jobs=$(($(nproc)+1)) - - name: Upload install-${{ matrix.target }}.log - uses: actions/upload-artifact@v4 + - name: Cache newcob.val + uses: actions/cache@v4 with: - name: install-${{ matrix.target }}.log - path: ${{ env.GITHUB_WORKSPACE }}/_build/install.log + path: _build/tests/cobol85/newcob.val + key: newcob-val + save-always: true + enableCrossOsArchive: true - name: Run testuite continue-on-error: true shell: msys2 {0} run: | - sed -i '/AT_SETUP(\[temporary path invalid\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/used_binaries.at - sed -i '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_accept.at - cd _build/tests - make check - make test - - - name: Upload testsuite-${{ matrix.target }}.log + sed '/AT_SETUP(\[temporary path invalid\])/a \ + AT_SKIP_IF(\[true\])' -i tests/testsuite.src/used_binaries.at + sed '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a \ + AT_SKIP_IF(\[true\])' -i tests/testsuite.src/run_accept.at + make -C _build/tests checkall \ + --jobs=$(($(nproc)+1)) \ + TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \ + make -C _build/tests check \ + TESTSUITEFLAGS="--recheck --verbose" + + - name: Upload testsuite-${{matrix.sys}}-${{matrix.target}}.log uses: actions/upload-artifact@v4 with: - name: testsuite-${{ matrix.target }}.log + name: testsuite-${{matrix.sys}}-${{matrix.target}}.log path: ${{ env.GITHUB_WORKSPACE }}/_build/tests/testsuite.log - name: Package GnuCOBOL + shell: msys2 {0} + run: | + make -C _build distmingw + + - name: Tar GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}} shell: msys2 {0} run: | cd _build - make distmingw + tar -cvf ../GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar \ + "${{ env.DISTDIR }}" - - name: Upload GnuCOBOL_mingw-${{ matrix.target }} + - name: Upload GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar uses: actions/upload-artifact@v4 with: - name: GnuCOBOL_mingw-${{ matrix.target }} - path: ${{ env.GITHUB_WORKSPACE }}/_build/${{ env.DISTDIR }} + name: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar + path: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar