Update windows-msys2.yml #710
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, Test and provide Nightly (Ubuntu + MSYS1) | |
| on: | |
| pull_request: | |
| branches: [ gitside-gnucobol-3.x ] | |
| push: | |
| # manual run in actions tab - for all branches | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build, test and provide nightly | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| isam: | |
| - db | |
| - vbisam | |
| steps: | |
| - name: Set git user | |
| run: | | |
| git config --global user.name github-actions | |
| git config --global user.email github-actions-bot@users.noreply.github.com | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup build environment | |
| run: echo "TERM=vt100" >> $GITHUB_ENV | |
| - name: Install packages | |
| run: | | |
| sudo apt -y update | |
| sudo apt -y install autoconf automake make libtool flex bison \ | |
| autopoint gettext help2man texinfo texlive \ | |
| gcc libgmp-dev libncurses-dev \ | |
| libdb5.3-dev libxml2-dev libcjson-dev | |
| - name: Restore VBISAM cache | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| id: restore-vbisam | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-vbisam | |
| path: vbisam | |
| - name: Build VBISAM | |
| if: ${{ matrix.isam == 'vbisam' && | |
| steps.restore-vbisam.outputs.cache-hit != 'true' }} | |
| run: | | |
| curl -LO http://inglenet.ca/Products/GnuCOBOL/vbisam-2.2.tar.Z | |
| mkdir vbisam && tar -xvzf vbisam-2.2.tar.Z -C vbisam --strip-components=1 | |
| cd vbisam | |
| ./configure --prefix=/opt/vbisam \ | |
| CFLAGS="-fstack-protector-strong -fstack-clash-protection -ggdb3 -fasynchronous-unwind-tables" \ | |
| LDFLAGS="-fstack-protector-strong -fstack-clash-protection" \ | |
| CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" | |
| make --jobs=$(($(nproc)+1)) | |
| - name: Install VBISAM | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| run: | | |
| sudo make -C vbisam install | |
| echo "CPATH=/opt/vbisam/include" >> $GITHUB_ENV | |
| echo "LIBRARY_PATH=/opt/vbisam/lib" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=/opt/vbisam/lib" >> $GITHUB_ENV | |
| - name: Save VBISAM cache | |
| if: ${{ matrix.isam == 'vbisam' && | |
| steps.restore-vbisam.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-vbisam | |
| path: vbisam | |
| - name: Bootstrap GnuCOBOL | |
| run: ./build_aux/bootstrap install | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _build && cd _build | |
| ../configure --with-${{ matrix.isam }} \ | |
| --enable-cobc-internal-checks \ | |
| --enable-hardening \ | |
| --prefix=/opt/gnucobol \ | |
| --with-pkgversion="GnuCOBOL CI" | |
| echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV | |
| - name: Build GnuCOBOL | |
| run: make -C _build --jobs=$(($(nproc)+1)) | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-${{ github.job }}-${{ matrix.isam }}.log | |
| path: _build/config.log | |
| - name: Adjust testsuite for VBISAM | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| run: | | |
| cd tests/testsuite.src | |
| sed -i '/AT_SETUP(\[OUTPUT on INDEXED file to missing directory\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with LOCK MODE EXCLUSIVE\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with OPEN WITH LOCK\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with SHARING NO\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with SHARING READ ONLY\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with blocked lock\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[EXTFH: operation OP_GETINFO \/ QUERY-FILE\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[EXTFH: changing record address\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| # note: distcheck also creates the dist tarball | |
| - name: Build distribution archive & run tests | |
| run: | | |
| make -C _build distcheck --jobs=$(($(nproc)+1)) \ | |
| TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \ | |
| make -C _build/gnucobol-$VERSION/_build/sub/tests check \ | |
| TESTSUITEFLAGS="--recheck --verbose" | |
| make -C _build --jobs=$(($(nproc)+1)) dist DIST_TARGETS="dist-gzip distwin-zip" | |
| make -C _build --jobs=$(($(nproc)+1)) distbin DISTBIN_TARGETS="distbin-xz" | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-${{ github.job }}-${{ matrix.isam }}.log | |
| path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log | |
| - name: Upload dist tarball | |
| if: ${{ matrix.isam != 'vbisam' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gnucobol-ci source distribution | |
| path: _build/gnucobol*.tar.gz | |
| if-no-files-found: error | |
| retention-days: 0 | |
| - name: Upload dist tarball (Windows) | |
| if: ${{ matrix.isam != 'vbisam' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gnucobol-ci windows source distribution | |
| path: _build/gnucobol*.zip | |
| if-no-files-found: error | |
| retention-days: 0 | |
| - name: Upload test binaries | |
| if: ${{ matrix.isam != 'vbisam' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gnucobol-ci binary distribution | |
| path: _build/gnucobol*.tar.xz | |
| if-no-files-found: error | |
| retention-days: 0 | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Run NIST85 testsuite | |
| run: make -C _build test --jobs=$(($(nproc)+1)) | |
| - name: Upload NIST85 Test Suite results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NIST85 results on ${{ github.job }}-${{ matrix.isam }} | |
| path: | | |
| _build/tests/cobol85/summary.* | |
| _build/tests/cobol85/**/*.log | |
| _build/tests/cobol85/**/*.out | |
| _build/tests/cobol85/**/duration.txt | |
| build_clang: | |
| name: Build, test and provide nightly (Clang) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| isam: | |
| - db | |
| - vbisam | |
| steps: | |
| - name: Set git user | |
| run: | | |
| git config --global user.name github-actions | |
| git config --global user.email github-actions-bot@users.noreply.github.com | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup build environment | |
| run: echo "TERM=vt100" >> $GITHUB_ENV | |
| - name: Install packages | |
| run: | | |
| sudo apt -y update | |
| sudo apt -y install autoconf automake make libtool flex bison \ | |
| autopoint gettext help2man texinfo texlive \ | |
| clang libgmp-dev libncurses-dev \ | |
| libdb5.3-dev libxml2-dev libcjson-dev | |
| - name: Restore VBISAM cache | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| id: restore-vbisam | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-vbisam-clang | |
| path: vbisam | |
| - name: Build VBISAM | |
| if: ${{ matrix.isam == 'vbisam' && | |
| steps.restore-vbisam.outputs.cache-hit != 'true' }} | |
| run: | | |
| curl -LO http://inglenet.ca/Products/GnuCOBOL/vbisam-2.2.tar.Z | |
| mkdir vbisam && tar -xvzf vbisam-2.2.tar.Z -C vbisam --strip-components=1 | |
| cd vbisam | |
| ./configure --prefix=/opt/vbisam \ | |
| CC=clang \ | |
| CFLAGS="-fstack-protector-strong -fstack-clash-protection -ggdb3 -fasynchronous-unwind-tables" \ | |
| LDFLAGS="-fstack-protector-strong -fstack-clash-protection" \ | |
| CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" | |
| make --jobs=$(($(nproc)+1)) | |
| - name: Install VBISAM | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| run: | | |
| sudo make -C vbisam install | |
| echo "CPATH=/opt/vbisam/include" >> $GITHUB_ENV | |
| echo "LIBRARY_PATH=/opt/vbisam/lib" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=/opt/vbisam/lib" >> $GITHUB_ENV | |
| - name: Save VBISAM cache | |
| if: ${{ matrix.isam == 'vbisam' && | |
| steps.restore-vbisam.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-vbisam-clang | |
| path: vbisam | |
| - name: Bootstrap GnuCOBOL | |
| run: ./build_aux/bootstrap install | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _build && cd _build | |
| ../configure --with-${{ matrix.isam }} \ | |
| --enable-cobc-internal-checks \ | |
| --enable-hardening \ | |
| --prefix=/opt/gnucobol \ | |
| --with-pkgversion="GnuCOBOL CI" \ | |
| CC=clang | |
| echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV | |
| - name: Build GnuCOBOL | |
| run: make -C _build --jobs=$(($(nproc)+1)) | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-${{ github.job }}-${{ matrix.isam }}.log | |
| path: _build/config.log | |
| - name: Adjust testsuite for VBISAM | |
| if: ${{ matrix.isam == 'vbisam' }} | |
| run: | | |
| cd tests/testsuite.src | |
| sed -i '/AT_SETUP(\[OUTPUT on INDEXED file to missing directory\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with LOCK MODE EXCLUSIVE\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with OPEN WITH LOCK\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with SHARING NO\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with SHARING READ ONLY\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[INDEXED file with blocked lock\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[EXTFH: operation OP_GETINFO \/ QUERY-FILE\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| sed -i '/AT_SETUP(\[EXTFH: changing record address\])/a \ | |
| AT_SKIP_IF(\[true\])' run_file.at | |
| - name: Run testsuite | |
| run: | | |
| make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \ | |
| make -C _build check TESTSUITEFLAGS="--recheck --verbose" | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-${{ github.job }}-${{ matrix.isam }}.log | |
| path: _build/tests/testsuite.log | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Run NIST85 testsuite | |
| run: make -C _build test --jobs=$(($(nproc)+1)) | |
| - name: Upload NIST85 Test Suite results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NIST85 results on ${{ github.job }}-${{ matrix.isam }} | |
| path: | | |
| _build/tests/cobol85/summary.* | |
| _build/tests/cobol85/**/*.log | |
| _build/tests/cobol85/**/*.out | |
| _build/tests/cobol85/**/duration.txt | |
| build_32_bit: | |
| name: Build and test on 32-bit | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Get CI dist tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnucobol-ci source distribution | |
| - name: Extract CI dist tarball | |
| run: tar -xvf gnucobol*.tar.* --strip-components=1 | |
| - name: Setup build environment | |
| run: echo "TERM=vt100" >> $GITHUB_ENV | |
| - name: Install packages | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt -y update | |
| sudo apt -y install make libtool gcc-9-multilib \ | |
| gcc-9 libgmp-dev:i386 libncurses-dev:i386 \ | |
| libdb5.3-dev:i386 libxml2-dev:i386 libcjson-dev:i386 | |
| sudo apt -y remove flex bison | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _build && cd _build | |
| ../configure --with-db \ | |
| --enable-cobc-internal-checks \ | |
| --enable-hardening \ | |
| --prefix=/opt/gnucobol \ | |
| CC="gcc-9 -m32" \ | |
| CFLAGS="-fno-tree-coalesce-vars" | |
| # Note: we pass -fno-tree-coalesce-vars to workaround a bug | |
| # occurring with gcc on x86 at optimization level -O1 | |
| - name: Build GnuCOBOL | |
| run: make -C _build --jobs=$(($(nproc)+1)) | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-${{ github.job }}.log | |
| path: _build/config.log | |
| - name: Run testsuite | |
| run: | | |
| make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \ | |
| make -C _build check TESTSUITEFLAGS="--recheck --verbose" | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-${{ github.job }}.log | |
| path: _build/tests/testsuite.log | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Run NIST85 testsuite | |
| run: make -C _build test --jobs=$(($(nproc)+1)) | |
| - name: Upload NIST85 Test Suite results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NIST85 results on ${{ github.job }} | |
| path: | | |
| _build/tests/cobol85/summary.* | |
| _build/tests/cobol85/**/*.log | |
| _build/tests/cobol85/**/*.out | |
| _build/tests/cobol85/**/duration.txt | |
| build_minimal: | |
| name: Build and test with minimal dependencies | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Get CI dist tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnucobol-ci source distribution | |
| - name: Extract CI dist tarball | |
| run: tar -xvf gnucobol*.tar.* --strip-components=1 | |
| - name: Install packages | |
| run: | | |
| sudo apt -y update | |
| sudo apt -y install make libtool gcc libgmp-dev | |
| sudo apt -y remove flex bison | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _build && cd _build | |
| ../configure --without-curses --without-db --without-xml2 \ | |
| --without-json --without-iconv --disable-nls \ | |
| --disable-dependency-tracking | |
| - name: Build GnuCOBOL | |
| run: make -C _build --jobs=$(($(nproc)+1)) | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-${{ github.job }}.log | |
| path: _build/config.log | |
| - name: Run testsuite | |
| run: | | |
| make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \ | |
| make -C _build check TESTSUITEFLAGS="--recheck --verbose" | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-${{ github.job }}.log | |
| path: _build/tests/testsuite.log | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Run NIST85 testsuite | |
| run: make -C _build test --jobs=$(($(nproc)+1)) | |
| - name: Upload NIST85 Test Suite results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NIST85 results on ${{ github.job }} | |
| path: | | |
| _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 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Get CI dist tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnucobol-ci source distribution | |
| - name: Extract CI dist tarball | |
| run: tar -xvf gnucobol*.tar.* --strip-components=1 | |
| - name: Setup build environment | |
| run: echo "TERM=vt100" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: | | |
| sudo apt -y update | |
| sudo apt -y install lcov make libtool \ | |
| gcc libgmp-dev libncurses-dev \ | |
| libdb-dev libxml2-dev libcjson-dev | |
| sudo apt -y remove libreadline-dev | |
| # note: add additional C compiler syntax checks here to not need _another_ CI run | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _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 GnuCOBOL | |
| run: make -C _build --jobs=$(($(nproc)+1)) | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-${{ github.job }}.log | |
| path: _build/config.log | |
| - name: Coverage | |
| run: | | |
| # 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" | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-${{ github.job }}.log | |
| path: _build/tests/testsuite.log | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: _build/GnuCOBOL-**-coverage | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Extended coverage | |
| run: | | |
| make -C _build 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 | |
| path: _build/extended-coverage | |
| - name: Upload coverage to codecov | |
| uses: codecov/codecov-action@v3 | |
| 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) | |
| msys_build_test_createdist: | |
| needs: build | |
| runs-on: windows-latest | |
| timeout-minutes: 40 # 30-35 min when building deps, 19-23 min when using cache | |
| env: | |
| MSYS_ROOT: C:\MinGW | |
| MSYS_BIN: C:\MinGW\msys\1.0\bin | |
| MSYSTEM: MINGW32 | |
| MSYSPKGS: msys-coreutils msys-patch pthreads | |
| MSYS_URL: https://www.arnoldtrembley.com/MinGW-bkup02.7z | |
| # Note: MSYS1 cannot connect to https://gmplib.org, so using GNU mirror side instead | |
| GMP_URL: https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz | |
| PDCM_URL: https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v4.4.0.tar.gz | |
| # Note: last version under old sleepycat license, newer is AGPL | |
| BDB_URL: https://download.oracle.com/berkeley-db/db-6.0.19.NC.tar.gz | |
| # Note: last version on MSYS2 building based on that BDB version | |
| BDBP_URL: https://raw.githubusercontent.com/msys2/MINGW-packages/ba87ffd249bd6021db6baeb60656627985996567/mingw-w64-db | |
| XML2_URL: https://github.com/GNOME/libxml2/archive/refs/tags/v2.8.0.tar.gz | |
| CJSON_URL: https://raw.githubusercontent.com/DaveGamble/cJSON/v1.7.19 | |
| defaults: | |
| run: | |
| shell: cmd | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - debug | |
| - release | |
| steps: | |
| - name: Get CI dist tarball | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: gnucobol-ci source distribution | |
| - name: Extract CI dist tarball | |
| shell: bash | |
| run: tar -xvf gnucobol*.tar.* --strip-components=1 | |
| - name: Setup build environment | |
| shell: pwsh | |
| run: | | |
| # echo $env:MSYS_BIN >> $env:GITHUB_PATH note: we need to prefix | |
| echo HOME=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV | |
| If ("${{ matrix.target }}" -eq "release") { | |
| echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV | |
| echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS" >> $env:GITHUB_ENV | |
| } Else { | |
| echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV | |
| echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV | |
| } | |
| - name: Restore MSYS1 cache | |
| id: restore-msys | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-msys-${{ matrix.target }} | |
| path: ${{ env.MSYS_ROOT }} | |
| - name: MSYS1 cache info | |
| if: steps.restore-msys.outputs.cache-hit == 'true' | |
| run: | | |
| echo initial setup | |
| bash -lc "echo PATH is $PATH" | |
| bash -lc "printf \"GCC in $(cd $(dirname $(which gcc)); pwd -W):\n$(gcc --version)\"" | |
| bash -lc "printf \"Bash in $(cd $(dirname $(which bash)); pwd -W):\n$(bash --version)\"" | |
| echo MSYS1 setup | |
| %MSYS_BIN%\bash -lc "echo PATH is $PATH" | |
| %MSYS_BIN%\bash -lc "printf \"GCC in $(cd $(dirname $(which gcc)); pwd -W):\n$(gcc --version)\"" | |
| %MSYS_BIN%\bash -lc "printf \"Bash in $(cd $(dirname $(which bash)); pwd -W):\n$(bash --version)\"" | |
| - name: Install MSYS1 | |
| if: steps.restore-msys.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L %MSYS_URL% -o msys.7z | |
| 7z x msys.7z -o%MSYS_ROOT% | |
| - name: Install MSYS1 packages | |
| if: steps.restore-msys.outputs.cache-hit != 'true' | |
| run: | | |
| %MSYS_BIN%\bash -lc "mingw-get install %MSYSPKGS%" | |
| - name: Cleanup MSYS1 env | |
| if: steps.restore-msys.outputs.cache-hit != 'true' | |
| run: | | |
| rmdir /Q /S %MSYS_ROOT%\docs | |
| rmdir /Q /S %MSYS_ROOT%\var | |
| rem if needed, use a newer multiarch GDB | |
| del /Q %MSYS_ROOT%\bin\gdb* | |
| - name: Save MSYS1 cache | |
| if: steps.restore-msys.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-msys-${{ matrix.target }} | |
| path: ${{ env.MSYS_ROOT }} | |
| - name: Restore GMP cache | |
| id: restore-gmp | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-msys-gmp-${{ matrix.target }} | |
| path: gmp | |
| - name: Build GMP | |
| if: steps.restore-gmp.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L %GMP_URL% -o gmp.tar.xz | |
| mkdir gmp && tar -xvf gmp.tar.xz -C gmp --strip-components=1 | |
| %MSYS_BIN%\bash -lc "cd gmp && ./configure --prefix=/mingw --enable-fat --enable-shared --disable-static ABI=32 CFLAGS=\"-Wno-attributes -Wno-ignored-attributes\"" | |
| %MSYS_BIN%\bash -lc "make -C gmp --jobs=$(($(nproc)+1))" | |
| - name: Install GMP | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C gmp install" | |
| - name: Save GMP cache | |
| if: steps.restore-gmp.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-msys-gmp-${{ matrix.target }} | |
| path: gmp | |
| - name: Restore PDCursesMod cache | |
| id: restore-pdcm | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-msys-pdcm-${{ matrix.target }} | |
| path: pdcm | |
| - name: Build PDCurses | |
| if: steps.restore-pdcm.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L %PDCM_URL% -o pdcm.tar.gz | |
| mkdir pdcm && tar -xvf pdcm.tar.gz -C pdcm --strip-components=1 | |
| %MSYS_BIN%\bash -lc "make -C pdcm/wincon --jobs=$(($(nproc)+1)) INFOEX=N CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" | |
| %MSYS_BIN%\bash -lc "make -C pdcm/wingui --jobs=$(($(nproc)+1)) CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" | |
| %MSYS_BIN%\bash -lc "make -C pdcm/vt --jobs=$(($(nproc)+1)) CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll CFLAGS=\"-Wall -Wextra -pedantic -g -DPDCDEBUG -fPIC -DPDC_DLL_BUILD\"" | |
| echo #define CHTYPE_64 > pdcm\pdcurses.h | |
| echo #define PDC_DLL_BUILD >> pdcm\pdcurses.h | |
| echo #include "pdcurses/curses.h" >> pdcm\pdcurses.h | |
| - name: Install PDCursesMod | |
| run: | | |
| set HOME=%HOME%\pdcm | |
| %MSYS_BIN%\bash -lc "install wincon/libpdcurses.dll.a /mingw/lib/" | |
| %MSYS_BIN%\bash -lc "install wincon/libpdcurses.dll /mingw/bin/" | |
| rem The following three are packaged as alternative variants for the user | |
| %MSYS_BIN%\bash -lc "install wincon/libpdcurses.dll /mingw/bin/libpdcurses-wincon.dll" | |
| %MSYS_BIN%\bash -lc "install wingui/libpdcurses.dll /mingw/bin/libpdcurses-wingui.dll" | |
| %MSYS_BIN%\bash -lc "install vt/libpdcurses.dll /mingw/bin/libpdcurses-vt.dll" | |
| %MSYS_BIN%\bash -lc "install -d /mingw/include/pdcurses" | |
| %MSYS_BIN%\bash -lc "install -m 0644 curses.h panel.h term.h /mingw/include/pdcurses/" | |
| %MSYS_BIN%\bash -lc "install -m 0644 pdcurses.h /mingw/include/" | |
| - name: Save PDCursesMod cache | |
| if: steps.restore-pdcm.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-msys-pdcm-${{ matrix.target }} | |
| path: pdcm | |
| - name: Restore BDB cache | |
| id: restore-bdb | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-msys-bdb-${{ matrix.target }} | |
| path: bdb | |
| - name: Build BDB | |
| if: steps.restore-bdb.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L %BDB_URL% -o bdb.tar.gz | |
| curl -L %BDBP_URL%/0001-db-tls-m4-fix-pthread.patch -o db-tls-m4-fix-pthread.patch | |
| curl -L %BDBP_URL%/mingw.patch -o mingw.patch | |
| curl -L %BDBP_URL%/clang_cxx_11.patch -o cx11.patch | |
| mkdir bdb && tar -xf bdb.tar.gz -C bdb --strip-components=1 | |
| rem assume non-unicode, otherwise replace by wcslen (or MBCS: _mbstrlen) | |
| sed -i 's/_tcsclen/strlen/' bdb\src\os_windows\os_stat.c | |
| %MSYS_BIN%\bash -lc "patch -d bdb -p1 -i ../db-tls-m4-fix-pthread.patch" | |
| %MSYS_BIN%\bash -lc "patch -d bdb -p1 -i ../mingw.patch" | |
| %MSYS_BIN%\bash -lc "patch -d bdb -p1 -i ../cx11.patch" | |
| %MSYS_BIN%\bash -lc "lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}; cd bdb/build_unix && ../dist/configure --prefix=/mingw --enable-mingw --enable-debug --disable-static --disable-replication --disable-tcl --without-cryptography LIBCSO_LIBS=-lwsock32 CC=/mingw/bin/gcc CPPFLAGS='-Wno-incompatible-pointer-types -Wno-old-style-definition'" | |
| %MSYS_BIN%\bash -lc "make -C bdb/build_unix --jobs=$(($(nproc)+1))" | |
| - name: Install BDB | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C bdb/build_unix install" | |
| - name: Save BDB cache | |
| if: steps.restore-bdb.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-msys-bdb-${{ matrix.target }} | |
| path: bdb | |
| - name: Restore LibXML2 cache | |
| id: restore-xml2 | |
| uses: actions/cache/restore@v4 | |
| with: | |
| key: cache-msys-xml2-${{ matrix.target }} | |
| path: libxml2 | |
| - name: Build LibXML2 | |
| if: steps.restore-xml2.outputs.cache-hit != 'true' | |
| run: | | |
| curl -L %XML2_URL% -o libxml2.tar.gz | |
| mkdir libxml2 && tar -xvf libxml2.tar.gz -C libxml2 --strip-components=1 | |
| %MSYS_BIN%\bash -lc "cd libxml2 && ./autogen.sh && ./configure --prefix=/mingw --enable-debug" | |
| %MSYS_BIN%\bash -lc "make -C libxml2 --jobs=$(($(nproc)+1))" | |
| - name: Install LibXML2 | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C libxml2 install" | |
| - name: Save LibXML2 cache | |
| if: steps.restore-xml2.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v4 | |
| with: | |
| key: cache-msys-xml2-${{ matrix.target }} | |
| path: libxml2 | |
| - name: Download cJSON | |
| run: curl -LO %CJSON_URL%/cJSON.{c,h} --output-dir libcob | |
| - name: Configure GnuCOBOL | |
| run: | | |
| mkdir _build | |
| %MSYS_BIN%\bash -lc "cd _build && ../configure --with-db --with-xml2 --with-json=local --with-curses=pdcurses --prefix=/mingw %CFGOPT% LDFLAGS=-lintl" | |
| - name: Build GnuCOBOL | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C _build --jobs=$(($(nproc)+1)) CPATH=$(pwd)" | |
| rem Note: the extra CPATH above is only required in debug builds | |
| rem (otherwise gcc invoked from cobc does not find libcob.h [pre-inst-env]), for some reason... | |
| - name: Upload config.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: config-msys-${{ matrix.target }}.log | |
| path: _build/config.log | |
| - name: Cache newcob.val | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build/tests/cobol85/newcob.val | |
| key: newcob-val | |
| enableCrossOsArchive: true | |
| - name: Run NIST85 testsuite | |
| # if we ever need to disable something in the tests: skip like here IF106A | |
| # and later expect a failure | |
| # perl -pi -e 's/^# OBNC1M/\$skip{IF106A} = 1; # OBNC1M/' tests/cobol85/report.pl | |
| # %MSYS_BIN%\bash -lc "make -C _build test --jobs=$(($(nproc)+1)) CPATH=$(pwd) || echo \"WARNING: NIST85 did not pass!\"" | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C _build test --jobs=$(($(nproc)+1)) CPATH=$(pwd)" | |
| rem Note: the extra CPATH above is only required in debug builds | |
| rem (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason... | |
| - name: Upload NIST85 Test Suite results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NIST85 results on msys-${{ matrix.target }} | |
| path: | | |
| _build/tests/cobol85/summary.* | |
| _build/tests/cobol85/**/*.log | |
| _build/tests/cobol85/**/*.out | |
| _build/tests/cobol85/**/duration.txt | |
| - name: Run testsuite | |
| run: | | |
| rem skip test as it sometimes works and sometimes not... | |
| rem instead of | |
| rem sed -i '/AT_SETUP(\[temporary path invalid\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/used_binaries.at | |
| rem use | |
| %MSYS_BIN%\bash -lc "sed -i '/used_binaries/{N;/temporary path invalid/{N;N;N;N;s/traceon/traceon; echo \"workflow:1\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite" | |
| rem change to expected fail if there's an error specific to the CI that we don't want to change | |
| rem in the testsuite for expected result (should normally only be a temporary thing) | |
| rem instead of | |
| rem sed -i '/AT_SETUP(\[Compare FLOAT-LONG with floating-point literal\])/a AT_XFAIL_IF(\[true\])' tests/testsuite.src/run_fundamental.at | |
| rem use | |
| rem sed -i '/run_fundamental/{N;/Compare FLOAT-LONG with floating-point literal/{N;s/at_xfail=no/at_xfail=yes/;}}' tests/testsuite | |
| rem to work around regular hangs we run NIST first, then the internal | |
| rem and the later only with 2 jobs -> --jobs does not seem to have any effect in this env | |
| %MSYS_BIN%\bash -lc "make -C _build check TESTSUITEFLAGS=\"--jobs=2\" CPATH=$(pwd)" | |
| rem Note: the extra CPATH above is only required in debug builds | |
| rem (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason... | |
| - name: Upload testsuite.log | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testsuite-msys-${{ matrix.target }}.log | |
| path: _build/tests/testsuite.log | |
| - name: Package GnuCOBOL MinGW nightly | |
| run: | | |
| %MSYS_BIN%\bash -lc "make -C _build distmingw" | |
| - name: Upload GnuCOBOL_mingw | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GnuCOBOL_mingw-${{ matrix.target }} | |
| path: _build/${{ env.DISTDIR }} |