diff --git a/.github/workflows/macos-bdb.yml b/.github/workflows/macos-bdb.yml new file mode 100644 index 000000000..6ad7e64ef --- /dev/null +++ b/.github/workflows/macos-bdb.yml @@ -0,0 +1,129 @@ +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 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-visam.yml new file mode 100644 index 000000000..25019314f --- /dev/null +++ b/.github/workflows/macos-visam.yml @@ -0,0 +1,142 @@ +name: MacOS VISAM + +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: Installing VISAM prerequisite + run: | + wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z + tar -xvzf visam-2.2.tar.Z + cd visam-2.2 + ./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault + chmod u+x build_aux/install-sh + make + sudo make install + echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV + 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 + 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 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 + + - 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/ubuntu-bdb.yml b/.github/workflows/ubuntu-bdb.yml new file mode 100644 index 000000000..722d3e101 --- /dev/null +++ b/.github/workflows/ubuntu-bdb.yml @@ -0,0 +1,205 @@ +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-visam.yml new file mode 100644 index 000000000..0b745c4cf --- /dev/null +++ b/.github/workflows/ubuntu-visam.yml @@ -0,0 +1,217 @@ +name: Ubuntu VISAM + +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: Installing VISAM prerequisite + run: | + wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z + tar -xvzf visam-2.2.tar.Z + cd visam-2.2 + ./configure --prefix=/usr/local/visam-2.2 --enable-vbisamdefault + make + sudo make install + echo "CPATH=/usr/local/visam-2.2/include" >> $GITHUB_ENV + 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 + 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-visam --with-indexed=visam --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/windows-msvc-bdb.yml b/.github/workflows/windows-msvc-bdb.yml new file mode 100644 index 000000000..fb7d20d3a --- /dev/null +++ b/.github/workflows/windows-msvc-bdb.yml @@ -0,0 +1,158 @@ +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 "%VCPKG_ROOT%\installed\x64-windows\include" + set COB_LIBS=libcob-5.lib /LIBPATH:"%cd%\build_windows\x64\Release" + call "%VCVARS%" + 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-msys1-bdb.yml b/.github/workflows/windows-msys1-bdb.yml new file mode 100644 index 000000000..a193040b8 --- /dev/null +++ b/.github/workflows/windows-msys1-bdb.yml @@ -0,0 +1,156 @@ +name: Windows MSYS1 BDB (build only) + +on: + pull_request: + branches: [ gc4 ] + push: + branches: [ gc3_to_gc4 ] + # 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 + + MSYSTEM: MINGW32 + MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man + + M4: m4 + + 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 + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: cmd + + 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=%GITHUB_WORKSPACE%>> %GITHUB_ENV% + + - name: Restore MSYS env + id: restore-msys + uses: actions/cache/restore@v3 + with: + key: cache-msys + 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: | + %MSYS_BIN%\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" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && tar -xvf %MINGW_BISON_VERS%.tar.xz" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%MINGW_BISON_VERS%\" && ./configure --prefix=/mingw && make" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%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" + # %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && tar -xvf %MINGW_GMP_VERS%.tar.xz" + # %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%MINGW_GMP_VERS%\" && ./configure --prefix=/mingw --enable-fat --enable-shared --disable-static CFLAGS=\"-Wno-attributes -Wno-ignored-attributes\" ABI=32 && make" + # %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%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" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && tar -xvf %MINGW_BDB_VERS%.tar.gz && sed -i 's/_tcsclen/strlen/' %MINGW_BDB_VERS%/src/os_windows/os_stat.c" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%MINGW_BDB_VERS%\build_unix\" && ../dist/configure --prefix=/mingw --enable-mingw --enable-debug --disable-static --disable-replication --disable-tcl LIBCSO_LIBS=-lwsock32 && make || make" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\%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" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && tar -xvf PDCursesMod-%MINGW_PDCM_VERS%.tar.xz" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\wincon\" && make INFOEX=N CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\wingui\" && make CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\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" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll.a /mingw/lib/" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll /mingw/bin/" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install wincon/libpdcurses.dll /mingw/bin/libpdcurses-wincon.dll" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install wingui/libpdcurses.dll /mingw/bin/libpdcurses-wingui.dll" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install vt/libpdcurses.dll /mingw/bin/libpdcurses-vt.dll" + %MSYS_BIN%\bash -lc "install -d /mingw/include/pdcurses" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\PDCursesMod-%MINGW_PDCM_VERS%\" && install -m 0644 curses.h panel.h term.h /mingw/include/pdcurses/" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\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 C:\MinGW\docs + rmdir /Q /S C:\MinGW\var + del /Q C:\MinGW\bin\gdb.exe + + - name: Save MSYS env + if: steps.restore-msys.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + key: cache-msys + 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" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && tar -xvf cjson-%MINGW_CJSON_VERS%.tar.xz" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && cp cjson-%MINGW_CJSON_VERS%/cJSON.[ch] ./libcob/" + + - name: Bootstrap GnuCOBOL + run: | + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && sed -i 's/AM_PROG_AR/m4_ifdef\(\[AM_PROG_AR\], \[AM_PROG_AR\]\)/g' ./configure.ac" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && sed -i 's/po extras doc tests/po extras tests/g' ./Makefile.am" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && ./autogen.sh" + + - name: Configure GnuCOBOL + run: | + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && sed -i 'N;s/else/else :;/g' ./configure" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && sed -i 's/\} else \:;/} else/g' ./configure" + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && ./configure" + + - name: Upload config.log + uses: actions/upload-artifact@v3 + if: failure() + with: + name: config.log + path: _build/config.log + + - name: Build GnuCOBOL + run: | + %MSYS_BIN%\bash -lc "cd \"%GITHUB_WORKSPACE%\" && make" diff --git a/.github/workflows/windows-msys2-bdb.yml b/.github/workflows/windows-msys2-bdb.yml new file mode 100644 index 000000000..fb148555f --- /dev/null +++ b/.github/workflows/windows-msys2-bdb.yml @@ -0,0 +1,95 @@ +name: Windows MSYS2 BDB (build only) + +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: + - windows-latest + + 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 + uses: msys2/setup-msys2@v2 + with: + update: true + install: autoconf automake libtool make mingw-w64-x86_64-ncurses mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cjson mingw-w64-x86_64-db mingw-w64-x86_64-gmp libdb-devel mingw-w64-x86_64-gcc flex bison gmp-devel help2man texinfo gettext-devel + + - 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: | + ./autogen.sh + autoconf + autoreconf --install --force + shell: msys2 {0} + + - name: Build environment setup + run: | + mkdir _build + shell: msys2 {0} + + - name: configure + run: | + cd _build + ../configure --with-db --with-indexed=db --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol --exec-prefix /opt/cobol/gnucobol + shell: msys2 {0} + + - name: Upload config.log + uses: actions/upload-artifact@v3 + if: failure() + with: + name: config.log + path: _build/config.log + + - name: make + run: | + sed -i '/#include /a \#include ' libcob/common.c + sed -i '/#include /a \#include ' libcob/mlio.c + cd _build + make --jobs=$(($(nproc)+1)) + shell: msys2 {0} + + - name: install + run: | + cd _build + make install + find /opt/cobol > install.log + shell: msys2 {0} + + - name: Upload install.log + uses: actions/upload-artifact@v3 + with: + name: install.log + path: _build/install.log + + - name: check + continue-on-error: true + run: | + 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))" + shell: msys2 {0} + + - name: Upload testsuite.log + uses: actions/upload-artifact@v3 + with: + name: testsuite.log + path: _build/tests/testsuite.log diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6f6278e4e --- /dev/null +++ b/.gitignore @@ -0,0 +1,82 @@ +*~ +*.la +.libs +*.lo +*.o +*.so + +.deps +Makefile.in + +/aclocal.m4 +/aminclude_static.am +/autom4te.cache +/bin/cob-config +/bin/cob-config.1 +/bin/cobcrun +/bin/cobcrun.1 +/bin/cobfile +/bin/gcdiff +/build +/cobc/cobc +/cobc/cobc.1 +/cobc/parser.c +/cobc/parser.h +/cobc/parser.output +/cobc/pplex.c +/cobc/ppparse.c +/cobc/ppparse.h +/cobc/scanner.c +/config.h +/config.h.in +/config.log +/config.status +/configure +/doc/cbchelp.tex +/doc/cbconf.tex +/doc/cbexceptions.tex +/doc/cbhelp.tex +/doc/cbintr.tex +/doc/cbmnem.tex +/doc/cbrese.tex +/doc/cbrunt.tex +/doc/cbsyst.tex +/doc/gnucobol.info +/doc/stamp-vti +/doc/version.texi +/libtool +/Makefile +/po/en@boldquot.po +/po/en@quot.po +/po/*.gmo +/po/POTFILES +/pre-inst-env +/stamp-h1 +/tarstamp.h +/tests/atconfig +/tests/atlocal +/tests/cobol85/copy/ +/tests/cobol85/copyalt/ +/tests/cobol85/DB/ +/tests/cobol85/EXEC85 +/tests/cobol85/EXEC85.cob +/tests/cobol85/IC/ +/tests/cobol85/IF/ +/tests/cobol85/IX/ +/tests/cobol85/NC/ +/tests/cobol85/newcob.val +/tests/cobol85/OB/ +/tests/cobol85/RL/ +/tests/cobol85/RW/ +/tests/cobol85/SG/ +/tests/cobol85/SM/ +/tests/cobol85/SQ/ +/tests/cobol85/ST/ +/tests/cobol85/summary.log +/tests/package.m4 +/tests/run_prog_manual.sh +/tests/testsuite +/tests/testsuite.dir/ +/tests/testsuite.log +/tests/testsuite_manual +/build_aux/ar-lib