diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ffc2dcec1..aa61cb3b2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,6 +5,8 @@ on: branches: [ gcos4gnucobol-3.x ] push: branches: [ gcos4gnucobol-3.x ] + # manual run in actions tab - for all branches + workflow_dispatch: jobs: build: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 352b6282f..a16d542aa 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -4,6 +4,7 @@ on: pull_request: branches: [ gcos4gnucobol-3.x ] push: + branches: [ gcos4gnucobol-3.x ] # manual run in actions tab - for all branches workflow_dispatch: diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml new file mode 100644 index 000000000..179ba41de --- /dev/null +++ b/.github/workflows/windows-msvc.yml @@ -0,0 +1,216 @@ +name: Windows MSVC Workflow + +on: + pull_request: + branches: [ gcos4gnucobol-3.x ] + push: + branches: [ gcos4gnucobol-3.x ] + # manual run in actions tab - for all branches + workflow_dispatch: + +env: + GC_VERSION: GnuCOBOL 3.3-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 + 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 + + - name: Build GnuCOBOL + run: | + cd build_windows + set CL=/DCOB_MAIN_DIR=\"%GITHUB_WORKSPACE:\=\\%\" + "%MSBUILD%" .\vs2019\GnuCOBOL.sln /m /p:Platform=${{ matrix.arch }} /p:Configuration=${{ matrix.target }} + + - 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], [$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(\[CURRENCY SIGN WITH PICTURE SYMBOL\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at + sed -i '/AT_SETUP(\[FUNCTION RANDOM\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_functions.at + sed -i '/AT_SETUP(\[MOVE to edited item (4)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_functions.at + autom4te --lang=autotest -I ./testsuite.src ./testsuite.at -o ./testsuite + +# The following tests randomly hang (at least under debug configurations) +# CURRENCY SIGN WITH PICTURE SYMBOL +# FUNCTION RANDOM +# MOVE to edited item (4) + + - name: Running testsuite + continue-on-error: true + run: | + cd tests + set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include" + call "%VCVARS%" + set CHERE_INVOKING=1 + 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 COB_CFLAGS=/I "%cd%" /I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include" + # set COB_LIBS=libcob.lib /LIBPATH:"%cd%\build_windows\${{ env.ARCHDIR }}\${{ matrix.target }}" /FORCE:MULTIPLE + # set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include" + # call "%VCVARS%" + # cmd /C .\makedist.cmd + + # - name: Upload distribution + # uses: actions/upload-artifact@v4 + # with: + # name: GnuCOBOL_3.3-dev_${{ matrix.arch }}-${{ matrix.target }}.7z + # path: ${{ env.GITHUB_WORKSPACE }}/GnuCOBOL_3.3-dev_vs_bin.7z diff --git a/.github/workflows/windows-msys1.yml b/.github/workflows/windows-msys1.yml new file mode 100644 index 000000000..1233bedc8 --- /dev/null +++ b/.github/workflows/windows-msys1.yml @@ -0,0 +1,227 @@ +name: Windows MSYS1 Workflow + +on: + pull_request: + branches: [ gcos4gnucobol-3.x ] + push: + branches: [ gcos4gnucobol-3.x ] + # 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 + arch: + - x86 + 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 --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.yml b/.github/workflows/windows-msys2.yml new file mode 100644 index 000000000..370ef71a1 --- /dev/null +++ b/.github/workflows/windows-msys2.yml @@ -0,0 +1,118 @@ +name: Windows MSYS2 Workflow + +on: + pull_request: + branches: [ gcos4gnucobol-3.x ] + push: + branches: [ gcos4gnucobol-3.x ] + # manual run in actions tab - for all branches + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + arch: + - 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 + run: | + 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 + } Else { + echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV + echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV + } + + - 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 GnuCOBOL + shell: msys2 {0} + run: | + ./autogen.sh + autoconf + autoreconf --install --force + + - name: Configure GnuCOBOL + shell: msys2 {0} + run: | + mkdir _build + cd _build + ../configure $CFGOPT --with-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 + shell: msys2 {0} + run: | + cd _build + make --jobs=$(($(nproc)+1)) + + - name: Install GnuCOBOL + shell: msys2 {0} + run: | + cd _build + make install + find /opt/cobol > install.log + + - 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 testuite + shell: msys2 {0} + run: | + sed -i '/AT_SETUP(\[temporary path invalid\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/used_binaries.at + cd _build/tests + make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" + 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 + shell: msys2 {0} + run: | + 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.yml b/.github/workflows/windows.yml deleted file mode 100644 index e238d741a..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Windows Workflow - -on: - pull_request: - branches: [ gcos4gnucobol-3.x ] - push: - branches: [ gcos4gnucobol-3.x ] - # 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-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 --enable-cobc-internal-checks --enable-hardening --prefix /opt/cobol/gnucobol-gcos --exec-prefix /opt/cobol/gnucobol-gcos - 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: | - 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: | - cd _build/tests - make check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || (echo "not all tests passed") - make test - shell: msys2 {0} - - - name: Upload testsuite.log - uses: actions/upload-artifact@v3 - with: - name: testsuite.log - path: _build/tests/testsuite.log