diff --git a/.github/workflows/macos-bdb.yml b/.github/workflows/macos-bdb.yml deleted file mode 100644 index f833f3577..000000000 --- a/.github/workflows/macos-bdb.yml +++ /dev/null @@ -1,130 +0,0 @@ -name: MacOS BDB - -on: - pull_request: - branches: [ gc4 ] - push: - branches: [ gc3_to_gc4 ] - # manual run in actions tab - for all branches - workflow_dispatch: - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: - - macos-latest - - runs-on: ${{ matrix.os }} - - steps: - - name: Configure git - run: git config --global core.symlinks false - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install packages - run: | - brew install pkg-config automake libtool help2man texinfo bison berkeley-db@4 json-c - opt="/opt/homebrew/opt" - echo "$opt/pkg-config/bin" >> $GITHUB_PATH - echo "$opt/bison/bin" >> $GITHUB_PATH - echo "LDFLAGS=-L$opt/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV - echo "CPPFLAGS=-I$opt/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV - - - 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: bootstrap - run: | - sed -i '' 's/-undefined suppress//g' configure.ac - ./autogen.sh - autoconf - autoreconf --install --force - - - 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: | - cd _build - export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS" - export CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS" - ../configure --with-db --with-indexed=db --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol - - - name: Upload config.log - uses: actions/upload-artifact@v3 - with: - name: config.log - path: _build/config.log - if: failure() - - - name: make - run: | - cd _build - make --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 - - name: make install - run: | - cd _build - sudo make install - find /opt/cobol > install.log - - - name: Upload install.log - uses: actions/upload-artifact@v3 - with: - name: install.log - path: _build/install.log - - - name: check - run: | - sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a\ - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at - sed -i '' '/AT_SETUP(\[EXTFH: using ISAM callback\])/a\ - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at - sed -i '' '/AT_SETUP(\[trace feature\])/a\ - AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at - sed -i '' '/AT_SETUP(\[trace feature with subroutine\])/a\ - 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))" - - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 - if: failure() - with: - name: testsuite.log - path: _build/tests/testsuite.log - - - name: Cache newcob.val.Z - uses: actions/cache@v3 - id: newcob - with: - path: _build/tests/cobol85/newcob.val.Z.cached - key: newcob - - - 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 - - - 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 diff --git a/.github/workflows/macos-visam.yml b/.github/workflows/macos.yml similarity index 82% rename from .github/workflows/macos-visam.yml rename to .github/workflows/macos.yml index 7dac8a9ea..32007a47b 100644 --- a/.github/workflows/macos-visam.yml +++ b/.github/workflows/macos.yml @@ -1,10 +1,10 @@ -name: MacOS VISAM +name: MacOS on: pull_request: branches: [ gc4 ] push: - branches: [ gc3_to_gc4 ] + branches: [ gc4, gc4_ci ] # manual run in actions tab - for all branches workflow_dispatch: @@ -15,16 +15,24 @@ jobs: matrix: os: - macos-latest + isam: + - db + - visam runs-on: ${{ matrix.os }} steps: + - name: Configure git run: git config --global core.symlinks false - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - 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@v3 + uses: actions/checkout@v4 - name: Install packages run: | @@ -35,12 +43,8 @@ jobs: echo "LDFLAGS=-L$opt/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV echo "CPPFLAGS=-I$opt/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV - - 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: Installing VISAM prerequisite + if: ${{ matrix.isam == 'visam' }} run: | wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z tar -xvzf visam-2.2.tar.Z @@ -72,14 +76,14 @@ jobs: cd _build export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS" export CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS" - ../configure --with-visam --with-indexed=visam --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 --exec-prefix /opt/cobol/gnucobol - - name: Upload config.log - uses: actions/upload-artifact@v3 + - name: Upload config-${{ matrix.isam }}.log + uses: actions/upload-artifact@v4 + if: failure() with: - name: config.log + name: config-${{ matrix.isam }}.log path: _build/config.log - if: failure() - name: make run: | @@ -94,10 +98,10 @@ jobs: sudo make install find /opt/cobol > install.log - - name: Upload install.log - uses: actions/upload-artifact@v3 + - name: Upload install-${{ matrix.isam }}.log + uses: actions/upload-artifact@v4 with: - name: install.log + name: install-${{ matrix.isam }}.log path: _build/install.log - name: check @@ -115,19 +119,19 @@ jobs: cd _build make check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 + - name: Upload testsuite-${{ matrix.isam }}.log + uses: actions/upload-artifact@v4 if: failure() with: - name: testsuite.log + name: testsuite-${{ matrix.isam }}.log path: _build/tests/testsuite.log - name: Cache newcob.val.Z - uses: actions/cache@v3 + uses: actions/cache@v4 id: newcob with: path: _build/tests/cobol85/newcob.val.Z.cached - key: newcob + key: newcob-${{ matrix.isam }} - name: Download newcob.val.Z if: steps.newcob.outputs.cache-hit != 'true' diff --git a/.github/workflows/ubuntu-bdb.yml b/.github/workflows/ubuntu-bdb.yml deleted file mode 100644 index 722d3e101..000000000 --- a/.github/workflows/ubuntu-bdb.yml +++ /dev/null @@ -1,205 +0,0 @@ -name: Ubuntu BDB - -on: - pull_request: - branches: [ gc4 ] - push: - branches: [ gc3_to_gc4 ] - # manual run in actions tab - for all branches - workflow_dispatch: - -jobs: - build: - name: Build, test and provide nightly - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - include: - - os: ubuntu-latest - skip_test: true - - runs-on: ${{ matrix.os }} - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout code - uses: actions/checkout@v3 - - - 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 - - - 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: bootstrap - run: | - ./build_aux/bootstrap - - # FIXME: With TERM="dumb" `make check` fails with: - # ... - # 571: ACCEPT OMITTED (SCREEN) FAILED (run_accept.at:307) - # ... - # 693: ON EXCEPTION clause of DISPLAY FAILED (run_misc.at:6335) - # 695: LINE/COLUMN 0 exceptions FAILED (run_misc.at:6414) - # 694: EC-SCREEN-LINE-NUMBER and -STARTING-COLUMN FAILED (run_misc.at:6376) - # ... - # Failure cases read: "Error opening terminal: unknown." on - # stderr, and exit with code 1. - # - # Another alternative is passing `--with-curses=no` to the - # configure script, yet distcheck does call configure too... - # - - name: Build environment setup - run: | - mkdir _build - export TERM="vt100" - echo "TERM=$TERM" >> $GITHUB_ENV - echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV - - - name: configure - run: | - cd _build - ../configure --with-db --with-indexed=db --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.log - uses: actions/upload-artifact@v3 - if: failure() - with: - name: config.log - path: _build/config.log - - - name: make - run: | - cd _build - make --jobs=$(($(nproc)+1)) - - # - name: check - # run: | - # cd _build - # make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" - - # note: distcheck also creates the dist tarball - - name: distcheck - run: | - cd _build - make --jobs=$(($(nproc)+1)) distcheck TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" - - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 - if: failure() - with: - # Assume there's only one directory matching `_build/gnucobol-*`: - name: testsuite.log - path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log - - - name: Upload dist tarball - uses: actions/upload-artifact@v3.1.0 - with: - name: gnucobol-ci source distribution - path: _build/gnucobol*.tar* - if-no-files-found: error - retention-days: 0 - - - name: Cache newcob.val.Z - uses: actions/cache@v3 - id: newcob - with: - path: _build/tests/cobol85/newcob.val.Z.cached - key: newcob - - - 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 - - - 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 - - - uses: actions/upload-artifact@v3 - with: - name: NIST85 results - 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@v3 - - # 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 - - - name: bootstrap - run: | - ./build_aux/bootstrap - - - name: Build environment setup - run: | - mkdir _build - 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 - run: | - cd _build - ../configure --enable-code-coverage CPPFLAGS="-Werror=declaration-after-statement" - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: config.log - path: _build/config.log - - - name: make - run: | - cd _build - make --jobs=$(($(nproc)+1)) - - - name: coverage - run: | - cd _build - make check-code-coverage TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: testsuite.log - path: _build/tests/testsuite.log - - - uses: actions/upload-artifact@v3 - with: - name: coverage - path: _build/GnuCOBOL-**-coverage/ - - - 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/ubuntu-visam.yml b/.github/workflows/ubuntu.yml similarity index 84% rename from .github/workflows/ubuntu-visam.yml rename to .github/workflows/ubuntu.yml index 0b745c4cf..9b25ff5c6 100644 --- a/.github/workflows/ubuntu-visam.yml +++ b/.github/workflows/ubuntu.yml @@ -1,10 +1,10 @@ -name: Ubuntu VISAM +name: Ubuntu on: pull_request: branches: [ gc4 ] push: - branches: [ gc3_to_gc4 ] + branches: [ gc4, gc4_ci ] # manual run in actions tab - for all branches workflow_dispatch: @@ -16,6 +16,9 @@ jobs: matrix: os: - ubuntu-latest + isam: + - db + - visam include: - os: ubuntu-latest skip_test: true @@ -23,21 +26,22 @@ jobs: runs-on: ${{ matrix.os }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + + - 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@v3 + uses: actions/checkout@v4 - 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 - - 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: Installing VISAM prerequisite + if: ${{ matrix.isam == 'visam' }} run: | wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z tar -xvzf visam-2.2.tar.Z @@ -77,14 +81,14 @@ jobs: - name: configure run: | cd _build - ../configure --with-visam --with-indexed=visam --enable-cobc-internal-checks --enable-hardening --prefix ${INSTALL_PATH} + ../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.log - uses: actions/upload-artifact@v3 + - name: Upload config-${{ matrix.isam }}.log + uses: actions/upload-artifact@v4 if: failure() with: - name: config.log + name: config-${{ matrix.isam }}.log path: _build/config.log - name: make @@ -103,28 +107,28 @@ jobs: cd _build make --jobs=$(($(nproc)+1)) distcheck TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 + - name: Upload testsuite-${{ matrix.isam }}.log + uses: actions/upload-artifact@v4 if: failure() with: # Assume there's only one directory matching `_build/gnucobol-*`: - name: testsuite.log + name: testsuite-${{ matrix.isam }}.log path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log - name: Upload dist tarball - uses: actions/upload-artifact@v3.1.0 + uses: actions/upload-artifact@v4 with: - name: gnucobol-ci source distribution + name: gnucobol-ci source distribution (${{ matrix.isam }}) path: _build/gnucobol*.tar* if-no-files-found: error retention-days: 0 - name: Cache newcob.val.Z - uses: actions/cache@v3 + uses: actions/cache@v4 id: newcob with: path: _build/tests/cobol85/newcob.val.Z.cached - key: newcob + key: newcob-${{ matrix.isam }} - name: Download newcob.val.Z if: steps.newcob.outputs.cache-hit != 'true' @@ -139,9 +143,9 @@ jobs: ln -f newcob.val.Z.cached newcob.val.Z make EXEC85 && make --jobs=$(($(nproc)+1)) test - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: NIST85 results + name: NIST85 results (${{ matrix.isam }}) path: | _build/tests/cobol85/**/*.log _build/tests/cobol85/**/*.out @@ -157,7 +161,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # note: less dependencies as we don't generate a dist tarball, one additional for lcov - name: Install dependencies @@ -180,7 +184,7 @@ jobs: cd _build ../configure --enable-code-coverage CPPFLAGS="-Werror=declaration-after-statement" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: config.log @@ -196,13 +200,13 @@ jobs: cd _build make check-code-coverage TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: testsuite.log path: _build/tests/testsuite.log - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: coverage path: _build/GnuCOBOL-**-coverage/ diff --git a/.github/workflows/windows-msvc-bdb.yml b/.github/workflows/windows-msvc-bdb.yml deleted file mode 100644 index d793d8843..000000000 --- a/.github/workflows/windows-msvc-bdb.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: Windows MSVC BDB (build only) - -on: - pull_request: - branches: [ gc4 ] - push: - branches: [ gc3_to_gc4 ] - # manual run in actions tab - for all branches - workflow_dispatch: - -env: - FLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip - MSBUILD: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe - VCVARS: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat - VCPKG_ROOT: C:\vcpkg - VCPKGS: mpir:x64-windows pdcurses:x64-windows berkeleydb:x64-windows libxml2:x64-windows cjson:x64-windows - MSYS2_ROOT: C:\msys64 - MSYSPKGS: autoconf - MSYSTEM: UCRT64 - MSYSTEM_CHOST: x86_64-w64-mingw32 - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: - - windows-latest - - runs-on: ${{ matrix.os }} - - 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@v3 - - - name: Setup environment - run: echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV - - - name: Restore VCPKG package cache - id: restore-vcpkg - uses: actions/cache/restore@v3 - with: - key: cache-vcpkg - path: | - ${{ env.VCPKG_ROOT }}/installed - ${{ env.VCPKG_ROOT }}/packages - - - name: Install VCPKG packages - if: steps.restore-vcpkg.outputs.cache-hit != 'true' - run: | - cd $env:VCPKG_ROOT - git pull - .\bootstrap-vcpkg.bat -disableMetrics - vcpkg integrate install - vcpkg install (-split $env:VCPKGS) - vcpkg update - vcpkg upgrade (-split $env:VCPKGS) --no-dry-run - - - name: Save VCPKG package cache - if: steps.restore-vcpkg.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - key: cache-vcpkg - path: | - ${{ env.VCPKG_ROOT }}/installed - ${{ env.VCPKG_ROOT }}/packages - - - name: Restore WinFlexBison cache - uses: actions/cache/restore@v3 - id: restore-flexbison - with: - key: cache-flexbison - path: ${{ env.GITHUB_WORKSPACE }}\flexbison - - - name: Install WinFlexBison - if: steps.restore-flexbison.outputs.cache-hit != 'true' - run: | - Invoke-WebRequest -Uri $env:FLEXBISON -OutFile flexbison.zip - Expand-Archive flexbison.zip -DestinationPath flexbison - - - name: Save WinFlexBison cache - if: steps.restore-flexbison.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - key: cache-flexbison - path: ${{ env.GITHUB_WORKSPACE }}/flexbison - - - name: Configure GnuCOBOL - run: | - cd build_windows - Get-Content -Path 'config.h.in' | ForEach-Object { $_ ` - -replace '(#define\s+CONFIGURED_ISAM)\s.+$', '$1 BDB' ` - -replace '(#define\s+CONFIGURED_CURSES)\s.+$', '$1 PDCURSES' ` - -replace '(#define\s+CONFIGURED_XML)\s.+$', '$1 XML2' ` - -replace '(#define\s+CONFIGURED_JSON)\s.+$', '$1 CJSON_CJSON' ` - } | Set-Content -Path 'config.h' - & .\maketarstamp.ps1 > tarstamp.h - - - name: Generate parser - run: | - $env:PATH = "$pwd\flexbison;$env:PATH" - cd build_windows - cmd /C makebisonflex.cmd - - - name: Build GnuCOBOL - run: | - cd build_windows - vcpkg integrate install - & $env:MSBUILD "vs2019\GnuCOBOL.sln" /m /p:Platform=x64 /p:Configuration=Release - - - name: Install MSYS2 packages - shell: C:\shells\msys2bash.cmd {0} - run: | - pacman --needed --noconfirm -S $MSYSPKGS - - - name: Building testsuite - shell: C:\shells\msys2bash.cmd {0} - run: | - cd tests - echo at_testdir=\'tests\' > atconfig - echo abs_builddir=\'$(pwd)\' >> atconfig - echo at_srcdir=\'./\' >> atconfig - echo abs_srcdir=\'$(pwd)/\' >> atconfig - echo at_top_srcdir=\'../\' >> atconfig - echo abs_top_srcdir=\'$(pwd)/../\' >> atconfig - echo at_top_build_prefix=\'../\' >> atconfig - echo abs_top_builddir=\'$(pwd)/../\' >> atconfig - echo at_top_builddir=\$at_top_build_prefix >> atconfig - echo EXEEXT=\'.exe\' >> atconfig - echo AUTOTEST_PATH=\'tests\' >> atconfig - echo SHELL=\${CONFIG_SHELL-\'/bin/sh\'} >> atconfig - echo m4_define\([AT_PACKAGE_STRING], [GnuCOBOL 4.0-dev]\) > package.m4 - echo m4_define\([AT_PACKAGE_BUGREPORT], [bug-gnucobol@gnu.org]\) >> package.m4 - sed 's/x64\/Debug/x64\/Release/g' atlocal_win > atlocal - sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at - autom4te --lang=autotest -I ./testsuite.src ./testsuite.at -o ./testsuite - - - name: Running testsuite - continue-on-error: true - shell: cmd - run: | - set COB_CFLAGS=/I "%cd%" /I "%cd%\build_windows" /I "%VCPKG_ROOT%\installed\x64-windows\include" - set COB_LIBS=libcob-5.lib /LIBPATH:"%cd%\build_windows\x64\Release" - set PATH="%cd%\build_windows\x64\Release";"%cd%\bin";%PATH% - set COB_CONFIG_DIR=%cd%\config - call "%VCVARS%" - cd bin - cobc -x gcdiff.c - cd ..\tests - bash -c "./testsuite || ./testsuite --recheck --verbose" - - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 - with: - name: testsuite.log - path: ${{ env.GITHUB_WORKSPACE }}/tests/testsuite.log diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml new file mode 100644 index 000000000..4b706ad4a --- /dev/null +++ b/.github/workflows/windows-msvc.yml @@ -0,0 +1,223 @@ +name: Windows MSVC (build only) + +on: + pull_request: + branches: [ gc4 ] + push: + branches: [ gc4, gc4_ci ] + # manual run in actions tab - for all branches + workflow_dispatch: + +env: + GC_VERSION: GnuCOBOL 4.0-dev + + FLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip + + MSBUILD: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe + VCVARS32: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat + VCVARS64: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat + + VCPKG_ROOT: C:\vcpkg + VCPKGS32: mpir:x86-windows pdcurses:x86-windows berkeleydb:x86-windows libxml2:x86-windows cjson:x86-windows + VCPKGS64: mpir:x64-windows pdcurses:x64-windows berkeleydb:x64-windows libxml2:x64-windows cjson:x64-windows + + MSYS2_ROOT: C:\msys64 + MSYSTEM: UCRT64 + MSYSPKGS: autoconf + +defaults: + run: + shell: cmd + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + isam: + - db # Purely informative + arch: + - x86 + - x64 + target: + - Debug + - Release + + runs-on: ${{ matrix.os }} + + 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 environment + shell: pwsh + run: | + echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV + If ("${{ matrix.arch }}" -eq "x86") { + echo VCVARS=$env:VCVARS32 >> $env:GITHUB_ENV + echo VCPKGS=$env:VCPKGS32 >> $env:GITHUB_ENV + echo ARCHDIR=Win32 >> $env:GITHUB_ENV + } Else { + echo VCVARS=$env:VCVARS64 >> $env:GITHUB_ENV + echo VCPKGS=$env:VCPKGS64 >> $env:GITHUB_ENV + echo ARCHDIR=x64 >> $env:GITHUB_ENV + } + + - name: Restore VCPKG cache + id: restore-vcpkg + uses: actions/cache/restore@v4 + with: + key: cache-vcpkg-${{ matrix.arch }}-${{ matrix.target }} + path: | + ${{ env.VCPKG_ROOT }}/installed + ${{ env.VCPKG_ROOT }}/packages + + - name: Bootstrap VCPKG + if: steps.restore-vcpkg.outputs.cache-hit != 'true' + run: | + cd /d %VCPKG_ROOT% + vcpkg update + git pull + cmd /C .\bootstrap-vcpkg.bat -disableMetrics + + - name: Integrate VCPKG + run: | + vcpkg integrate install + + - name: Install VCPKG packages + if: steps.restore-vcpkg.outputs.cache-hit != 'true' + run: | + vcpkg install %VCPKGS% + + - name: Save VCPKG cache + if: steps.restore-vcpkg.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + key: cache-vcpkg-${{ matrix.arch }}-${{ matrix.target }} + path: | + ${{ env.VCPKG_ROOT }}/installed + ${{ env.VCPKG_ROOT }}/packages + + - name: Restore WinFlexBison cache + uses: actions/cache/restore@v4 + id: restore-flexbison + with: + key: cache-flexbison-${{ matrix.arch }}-${{ matrix.target }} + path: ${{ env.GITHUB_WORKSPACE }}/flexbison + + - name: Install WinFlexBison + if: steps.restore-flexbison.outputs.cache-hit != 'true' + shell: pwsh + run: | + Invoke-WebRequest -Uri $env:FLEXBISON -OutFile flexbison.zip + Expand-Archive flexbison.zip -DestinationPath flexbison + + - name: Save WinFlexBison cache + if: steps.restore-flexbison.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + key: cache-flexbison-${{ matrix.arch }}-${{ matrix.target }} + path: ${{ env.GITHUB_WORKSPACE }}/flexbison + + - name: Configure GnuCOBOL + shell: pwsh + run: | + cd build_windows + Get-Content -Path 'config.h.in' | ForEach-Object { $_ ` + -replace '(#define\s+CONFIGURED_ISAM)\s.+$', '$1 BDB' ` + -replace '(#define\s+CONFIGURED_CURSES)\s.+$', '$1 PDCURSES' ` + -replace '(#define\s+CONFIGURED_XML)\s.+$', '$1 XML2' ` + -replace '(#define\s+CONFIGURED_JSON)\s.+$', '$1 CJSON_CJSON' ` + } | Set-Content -Path 'config.h' + & .\maketarstamp.ps1 > tarstamp.h + + - name: Generate parser + run: | + cd build_windows + set PATH=%GITHUB_WORKSPACE%\flexbison;%PATH% + cmd /C .\makebisonflex.cmd atconfig + echo abs_builddir=\'$(pwd)\' >> atconfig + echo at_srcdir=\'./\' >> atconfig + echo abs_srcdir=\'$(pwd)/\' >> atconfig + echo at_top_srcdir=\'../\' >> atconfig + echo abs_top_srcdir=\'$(pwd)/../\' >> atconfig + echo at_top_build_prefix=\'../\' >> atconfig + echo abs_top_builddir=\'$(pwd)/../\' >> atconfig + echo at_top_builddir=\$at_top_build_prefix >> atconfig + echo EXEEXT=\'.exe\' >> atconfig + echo AUTOTEST_PATH=\'tests\' >> atconfig + echo SHELL=\${CONFIG_SHELL-\'/bin/sh\'} >> atconfig + echo m4_define\([AT_PACKAGE_STRING], [$GC_VERSION]\) > package.m4 + echo m4_define\([AT_PACKAGE_BUGREPORT], [bug-gnucobol@gnu.org]\) >> package.m4 + sed 's/x64\/Debug/${{ env.ARCHDIR }}\/${{ matrix.target }}/g' atlocal_win > atlocal + sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at + + 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 + + autom4te --lang=autotest -I ./testsuite.src ./testsuite.at -o ./testsuite + +# The tests in sed commands above randomly hang (under debug configurations) + + - name: Run testsuite + continue-on-error: true + run: | + cd tests + set PATH="%GITHUB_WORKSPACE%\build_windows\%ARCHDIR%\${{ matrix.target }}";"%GITHUB_WORKSPACE%\bin";%PATH% + set COB_CFLAGS=/I"%GITHUB_WORKSPACE%" /I"%GITHUB_WORKSPACE%\build_windows" + set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include" + call "%VCVARS%" + pushd ..\bin + cobc -x gcdiff.c + popd + set MSYS2_PATH_TYPE=inherit + C:\shells\msys2bash.cmd -c "./testsuite || ./testsuite --recheck --verbose" + + - name: Upload testsuite-${{ matrix.arch }}-${{ matrix.target }}.log + uses: actions/upload-artifact@v4 + with: + name: testsuite-${{ matrix.arch }}-${{ matrix.target }}.log + path: ${{ env.GITHUB_WORKSPACE }}/tests/testsuite.log + + # - name: Package GnuCOBOL + # run: | + # cd build_windows + # set PATH="%GITHUB_WORKSPACE%\build_windows\%ARCHDIR%\${{ matrix.target }}";"%GITHUB_WORKSPACE%\bin";%PATH% + # set COB_CFLAGS=/I"%GITHUB_WORKSPACE%" /I"%GITHUB_WORKSPACE%\build_windows" + # set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include" + # call "%VCVARS%" + # cmd /C .\makedist.cmd > $env:GITHUB_ENV - echo GHWS=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV - If ("${{ matrix.target }}" -eq "release") { - echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV - echo CFGOPT="" >> $env:GITHUB_ENV - } Else { - echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV - echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV - } - - - name: Restore MSYS env - id: restore-msys - uses: actions/cache/restore@v4 - with: - key: cache-msys-${{ matrix.target }} - path: | - ${{ env.MSYS_ROOT }} - - - name: Install MSYS1 - if: steps.restore-msys.outputs.cache-hit != 'true' - run: | - curl -O https://www.arnoldtrembley.com/MinGW-bkup02.7z - 7z x MinGW-bkup02.7z -o%MSYS_ROOT%\ - - - name: Install MSYS1 packages - if: steps.restore-msys.outputs.cache-hit != 'true' - run: | - %BASH% -lc "mingw-get install %MSYSPKGS%" - - - name: Install Bison 3.0 - if: steps.restore-msys.outputs.cache-hit != 'true' - run: | - curl -L "https://mirror.ibcp.fr/pub/gnu/bison/%MINGW_BISON_VERS%.tar.xz" -o "%MINGW_BISON_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%\" && tar -xvf %MINGW_BISON_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%/%MINGW_BISON_VERS%\" && ./configure --prefix=/mingw && make" - %BASH% -lc "cd \"%GHWS%/%MINGW_BISON_VERS%\" && make install" - - # - name: Install GMP - # if: steps.restore-msys.outputs.cache-hit != 'true' - # run: | - # curl -L "https://gmplib.org/download/gmp/%MINGW_GMP_VERS%.tar.xz" -o "%MINGW_GMP_VERS%.tar.xz" - # %BASH% -lc "cd \"%GHWS%\" && tar -xvf %MINGW_GMP_VERS%.tar.xz" - # %BASH% -lc "cd \"%GHWS%/%MINGW_GMP_VERS%\" && ./configure --prefix=/mingw --enable-fat --enable-shared --disable-static CFLAGS=\"-Wno-attributes -Wno-ignored-attributes\" ABI=32 && make" - # %BASH% -lc "cd \"%GHWS%/%MINGW_GMP_VERS%\" && make install" - - - name: Install BDB - if: steps.restore-msys.outputs.cache-hit != 'true' - run: | - curl -L "https://download.oracle.com/berkeley-db/%MINGW_BDB_VERS%.tar.gz" -o "%MINGW_BDB_VERS%.tar.gz" - %BASH% -lc "cd \"%GHWS%\" && tar -xvf %MINGW_BDB_VERS%.tar.gz && sed -i 's/_tcsclen/strlen/' %MINGW_BDB_VERS%/src/os_windows/os_stat.c" - %BASH% -lc "cd \"%GHWS%/%MINGW_BDB_VERS%/build_unix\" && ../dist/configure --prefix=/mingw --enable-mingw --enable-debug --disable-static --disable-replication --disable-tcl LIBCSO_LIBS=-lwsock32 && make || make" - %BASH% -lc "cd \"%GHWS%/%MINGW_BDB_VERS%/build_unix\" && make install" - - - name: Install PDCurses - if: steps.restore-msys.outputs.cache-hit != 'true' - run: | - curl -L "https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v%MINGW_PDCM_VERS%.tar.gz" -o "PDCursesMod-%MINGW_PDCM_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%\" && tar -xvf PDCursesMod-%MINGW_PDCM_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\wincon\" && make INFOEX=N CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\wingui\" && make CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\vt\" && make 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 > "PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h" && echo #define PDC_DLL_BUILD >> "PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h" && echo #include "pdcurses/curses.h" >> "PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll.a /mingw/lib/" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll /mingw/bin/" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll /mingw/bin/libpdcurses-wincon.dll" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install wingui/libpdcurses.dll /mingw/bin/libpdcurses-wingui.dll" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install vt/libpdcurses.dll /mingw/bin/libpdcurses-vt.dll" - %BASH% -lc "install -d /mingw/include/pdcurses" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install -m 0644 curses.h panel.h term.h /mingw/include/pdcurses/" - %BASH% -lc "cd \"%GHWS%/PDCursesMod-%MINGW_PDCM_VERS%\" && install -m 0644 pdcurses.h /mingw/include/" - - - 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 - del /Q %MSYS_ROOT%\bin\gdb.exe - - - name: Save MSYS env - if: steps.restore-msys.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - key: cache-msys-${{ matrix.target }} - path: | - ${{ env.MSYS_ROOT }} - - - name: Download CJSON sources - run: | - curl -L "https://github.com/DaveGamble/cJSON/archive/refs/tags/v%MINGW_CJSON_VERS%.tar.gz" -o "cjson-%MINGW_CJSON_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%\" && tar -xvf cjson-%MINGW_CJSON_VERS%.tar.xz" - %BASH% -lc "cd \"%GHWS%\" && cp cjson-%MINGW_CJSON_VERS%/cJSON.[ch] ./libcob/" - - - name: Bootstrap GnuCOBOL - run: | - %BASH% -lc "cd \"%GHWS%\" && sed -i 's/AM_PROG_AR/m4_ifdef\(\[AM_PROG_AR\], \[AM_PROG_AR\]\)/g' ./configure.ac" - %BASH% -lc "cd \"%GHWS%\" && sed -i 's/po extras doc tests/po extras tests/g' ./Makefile.am" - %BASH% -lc "cd \"%GHWS%\" && ./autogen.sh" - - - name: Configure GnuCOBOL - run: | - %BASH% -lc "cd \"%GHWS%\" && mkdir _build" - %BASH% -lc "cd \"%GHWS%\" && sed -i 'N;s/else/else :;/g' ./configure" - %BASH% -lc "cd \"%GHWS%\" && sed -i 's/\} else \:;/} else/g' ./configure" - %BASH% -lc "cd \"%GHWS%/_build\" && ../configure %CFGOPT% --with-db --with-indexed=db --prefix /opt/cobol/gnucobol" - - - name: Upload config-${{ matrix.target }}.log - uses: actions/upload-artifact@v4 - if: failure() - with: - name: config-${{ matrix.target }}.log - path: _build/config.log - - - name: Build GnuCOBOL - run: | - %BASH% -lc "cd \"%GHWS%/_build\" && CPATH=$(pwd)/.. make --jobs=$(($(nproc)+1))" - - - name: Install GnuCOBOL - run: | - %BASH% -lc "cd \"%GHWS%/_build\" && make install" - %BASH% -lc "cd \"%GHWS%/_build\" && find /opt/cobol > install.log" - - - name: Upload install-${{ matrix.target }}.log - uses: actions/upload-artifact@v4 - with: - name: install-${{ matrix.target }}.log - path: _build/install.log - - - name: Run testsuite - continue-on-error: true - run: | - %BASH% -lc "cd \"%GHWS%" && sed -i '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_accept.at" - %BASH% -lc "cd \"%GHWS%/_build/tests\" && CPATH=/opt/cobol/gnucobol/include make check TESTSUITEFLAGS=\"--jobs=$(($(nproc)+1))\"" - - - name: Upload testsuite-${{ matrix.target }}.log - uses: actions/upload-artifact@v4 - with: - name: testsuite-${{ matrix.target }}.log - path: _build/tests/testsuite.log - - - name: Package GnuCOBOL - run: | - %BASH% -lc "cd \"%GHWS%/_build\" && make distmingw" - - - name: Upload GnuCOBOL_mingw-${{ matrix.target }} - uses: actions/upload-artifact@v4 - with: - name: GnuCOBOL_mingw-${{ matrix.target }} - path: _build/${{ env.DISTDIR }} diff --git a/.github/workflows/windows-msys1.yml b/.github/workflows/windows-msys1.yml new file mode 100644 index 000000000..0baeee1e9 --- /dev/null +++ b/.github/workflows/windows-msys1.yml @@ -0,0 +1,229 @@ +name: Windows MSYS1 (build only) + +on: + pull_request: + branches: [ gc4 ] + push: + branches: [ gc4, gc4_ci ] + # manual run in actions tab - for all branches + workflow_dispatch: + +env: + MSYS_ROOT: C:\MinGW + MSYS_BIN: C:\MinGW\msys\1.0\bin + BISON_PKGDATADIR: C:\MinGW\share\bison + + M4: m4 + + MSYSTEM: MINGW32 + MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man + + MINGW_BISON_VERS: bison-3.0.1 + MINGW_GMP_VERS: gmp-6.3.0 + MINGW_BDB_VERS: db-6.0.19.NC + MINGW_PDCM_VERS: 4.4.0 + MINGW_CJSON_VERS: 1.7.18 + MINGW_XML2_VERS: 2.8.0 + +defaults: + run: + shell: cmd + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + isam: + - db # Purely informative + arch: + - x86 # Purely informative + target: + - debug + - release + + runs-on: ${{ matrix.os }} + + 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 environment + shell: pwsh + run: | + echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV + echo HOME=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV + echo PATH="$env:MSYS_BIN;$env:PATH" >> $env:GITHUB_ENV + If ("${{ matrix.target }}" -eq "release") { + echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV + echo CFGOPT= >> $env:GITHUB_ENV + } Else { + echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV + echo CFGOPT="--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: Install MSYS1 + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + curl -O https://www.arnoldtrembley.com/MinGW-bkup02.7z + 7z x MinGW-bkup02.7z -o%MSYS_ROOT%\ + + - name: Install MSYS1 packages + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + bash -lc "mingw-get install %MSYSPKGS%" + + - name: Install Bison 3.0 + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + curl -L https://mirror.ibcp.fr/pub/gnu/bison/%MINGW_BISON_VERS%.tar.xz -o %MINGW_BISON_VERS%.tar.xz + tar -xvf %MINGW_BISON_VERS%.tar.xz + 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) + # - name: Install GMP + # if: steps.restore-msys.outputs.cache-hit != 'true' + # run: | + # curl -L https://gmplib.org/download/gmp/%MINGW_GMP_VERS%.tar.xz -o %MINGW_GMP_VERS%.tar.xz + # tar -xvf %MINGW_GMP_VERS%.tar.xz + # bash -lc "cd %MINGW_GMP_VERS% && ./configure --prefix=/mingw --enable-fat --enable-shared --disable-static CFLAGS=\"-Wno-attributes -Wno-ignored-attributes\" ABI=32 && make" + # bash -lc "cd %MINGW_GMP_VERS% && make install" + + - name: Install BDB + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + curl -L https://download.oracle.com/berkeley-db/%MINGW_BDB_VERS%.tar.gz -o %MINGW_BDB_VERS%.tar.gz + tar -xvf %MINGW_BDB_VERS%.tar.gz + sed -i 's/_tcsclen/strlen/' %MINGW_BDB_VERS%\src\os_windows\os_stat.c + bash -lc "cd %MINGW_BDB_VERS%/build_unix && ../dist/configure --prefix=/mingw --enable-mingw --enable-debug --disable-static --disable-replication --disable-tcl LIBCSO_LIBS=-lwsock32 && make || make" + bash -lc "cd %MINGW_BDB_VERS%/build_unix && make install" + + - name: Install PDCurses + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + curl -L https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v%MINGW_PDCM_VERS%.tar.gz -o "PDCursesMod-%MINGW_PDCM_VERS%.tar.xz" + tar -xvf PDCursesMod-%MINGW_PDCM_VERS%.tar.xz + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS%\wincon && make INFOEX=N CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS%\wingui && make CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS%\vt && make 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 > PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h + echo #define PDC_DLL_BUILD >> PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h + echo #include "pdcurses/curses.h" >> PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll.a /mingw/lib/" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll /mingw/bin/" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll /mingw/bin/libpdcurses-wincon.dll" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wingui/libpdcurses.dll /mingw/bin/libpdcurses-wingui.dll" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install vt/libpdcurses.dll /mingw/bin/libpdcurses-vt.dll" + bash -lc "install -d /mingw/include/pdcurses" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install -m 0644 curses.h panel.h term.h /mingw/include/pdcurses/" + bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install -m 0644 pdcurses.h /mingw/include/" + + - name: Install LibXML2 + if: steps.restore-msys.outputs.cache-hit != 'true' + run: | + curl -L https://github.com/GNOME/libxml2/archive/refs/tags/v%MINGW_XML2_VERS%.tar.gz -o libxml2-%MINGW_XML2_VERS%.tar.xz + tar -xvf libxml2-%MINGW_XML2_VERS%.tar.xz + bash -lc "cd libxml2-%MINGW_XML2_VERS% && ./autogen.sh" + bash -lc "cd libxml2-%MINGW_XML2_VERS% && ./configure --prefix=/mingw && make" + bash -lc "cd libxml2-%MINGW_XML2_VERS% && make install" + + - 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 + del /Q %MSYS_ROOT%\bin\gdb.exe + + - 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: Download CJSON sources + run: | + curl -L https://github.com/DaveGamble/cJSON/archive/refs/tags/v%MINGW_CJSON_VERS%.tar.gz -o cjson-%MINGW_CJSON_VERS%.tar.xz + tar -xvf cjson-%MINGW_CJSON_VERS%.tar.xz + copy cjson-%MINGW_CJSON_VERS%\cJSON.* .\libcob + + - name: Bootstrap GnuCOBOL + run: | + sed -i 's/AM_PROG_AR/m4_ifdef\(\[AM_PROG_AR\], \[AM_PROG_AR\]\)/g' .\configure.ac + sed -i 's/po extras doc tests/po extras tests/g' .\Makefile.am + bash -lc "./autogen.sh" + + - name: Configure GnuCOBOL + run: | + mkdir _build + sed -i 'N;s/else/else :;/g' .\configure + sed -i 's/\} else \:;/} else/g' .\configure + sed -i 's/#else \:;/#else/g' .\configure + bash -lc "cd _build && ../configure %CFGOPT% --with-db --with-indexed=db --prefix=/opt/cobol/gnucobol" + + - name: Upload config-${{ matrix.target }}.log + uses: actions/upload-artifact@v4 + if: failure() + with: + name: config-${{ matrix.target }}.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/config.log + + - name: Build GnuCOBOL + run: | + bash -lc "cd _build && CPATH=$(pwd)/.. make --jobs=$(($(nproc)+1))" + +# Note: the extra CPATH above is only required in debug builds, for some reason... + + - name: Install GnuCOBOL + run: | + bash -lc "cd _build && make install" + bash -lc "cd _build && find /opt/cobol > install.log" + + - name: Upload install-${{ matrix.target }}.log + uses: actions/upload-artifact@v4 + with: + name: install-${{ matrix.target }}.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/install.log + + - name: Run testsuite + continue-on-error: true + run: | + sed -i '/AT_SETUP(\[temporary path invalid\])/a AT_SKIP_IF(\[true\])' .\tests\testsuite.src\used_binaries.at + bash -lc "cd _build/tests && CPATH=/opt/cobol/gnucobol/include make check TESTSUITEFLAGS=\"--jobs=$(($(nproc)+1))\"" + +# Note: the extra CPATH above is only required in debug builds, for some reason... + +# The NIST testsuite hangs forever in IF +# bash -lc "CPATH=/opt/cobol/gnucobol/include make test" + + - name: Upload testsuite-${{ matrix.target }}.log + uses: actions/upload-artifact@v4 + with: + name: testsuite-${{ matrix.target }}.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/tests/testsuite.log + + - name: Package GnuCOBOL + run: | + bash -lc "cd _build && make distmingw" + + - name: Upload GnuCOBOL_mingw-${{ matrix.target }} + uses: actions/upload-artifact@v4 + with: + name: GnuCOBOL_mingw-${{ matrix.target }} + path: ${{ env.GITHUB_WORKSPACE }}/_build/${{ env.DISTDIR }} diff --git a/.github/workflows/windows-msys2-bdb.yml b/.github/workflows/windows-msys2.yml similarity index 73% rename from .github/workflows/windows-msys2-bdb.yml rename to .github/workflows/windows-msys2.yml index 1ccbf3692..3990ca5e2 100644 --- a/.github/workflows/windows-msys2-bdb.yml +++ b/.github/workflows/windows-msys2.yml @@ -1,10 +1,10 @@ -name: Windows MSYS2 BDB (build only) +name: Windows MSYS2 (build only) on: pull_request: branches: [ gc4 ] push: - branches: [ gc3_to_gc4 ] + branches: [ gc4, gc4_ci ] # manual run in actions tab - for all branches workflow_dispatch: @@ -15,6 +15,10 @@ jobs: matrix: os: - windows-latest + isam: + - db # Purely informative + arch: + - x64 # Purely informative target: - debug - release @@ -36,47 +40,47 @@ jobs: echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV If ("${{ matrix.target }}" -eq "release") { echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV - echo CFGOPT="" >> $env:GITHUB_ENV + echo CFGOPT= >> $env:GITHUB_ENV } Else { echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV } - - name: Install packages + - name: Install MSYS2 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 - - name: bootstrap + - name: Bootstrap GnuCOBOL shell: msys2 {0} run: | ./autogen.sh autoconf autoreconf --install --force - - name: configure + - name: Configure GnuCOBOL shell: msys2 {0} run: | mkdir _build cd _build - ../configure $CFGOPT --with-db --with-indexed=db --prefix /opt/cobol/gnucobol + ../configure $CFGOPT --with-db --with-indexed=db --prefix=/opt/cobol/gnucobol - name: Upload config-${{ matrix.target }}.log uses: actions/upload-artifact@v4 if: failure() with: name: config-${{ matrix.target }}.log - path: _build/config.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/config.log - - name: make + - name: Build GnuCOBOL shell: msys2 {0} run: | cd _build make --jobs=$(($(nproc)+1)) - - name: install + - name: Install GnuCOBOL shell: msys2 {0} run: | cd _build @@ -87,23 +91,30 @@ jobs: uses: actions/upload-artifact@v4 with: name: install-${{ matrix.target }}.log - path: _build/install.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/install.log - - name: check + - 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 TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" + make check + make test + +# make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" +# also randomly in release +# FUNCTION PI +# FUNCTION RANDOM - name: Upload testsuite-${{ matrix.target }}.log uses: actions/upload-artifact@v4 with: name: testsuite-${{ matrix.target }}.log - path: _build/tests/testsuite.log + path: ${{ env.GITHUB_WORKSPACE }}/_build/tests/testsuite.log - - name: distmingw + - name: Package GnuCOBOL shell: msys2 {0} run: | cd _build @@ -113,4 +124,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: GnuCOBOL_mingw-${{ matrix.target }} - path: _build/${{ env.DISTDIR }} + path: ${{ env.GITHUB_WORKSPACE }}/_build/${{ env.DISTDIR }}