From 2f9b170bc7a798c24ac28c4a561743953cbf7712 Mon Sep 17 00:00:00 2001
From: Simon Sobisch <simonsobisch@web.de>
Date: Mon, 7 Oct 2024 20:01:56 +0000
Subject: [PATCH] ci adjustments

* ubuntu:
  * only run jobs for "coverage" and "additional warnings" if the main ci build works
    and use its generated tarball in both cases
  * add two new artifacts: test binaries and windows source
* ubuntu+msys1+msys2+macos:
  * upload config.log after the build - because we may need it to debug build issues
  * always upload the testsuite.log (additional build documentation)
* ubuntu+msys1+msys2:
  * use --with-pkgversion to mark CI binaries
* msys2+macos:
  * uploading NIST test results
* msys1:
  * GMP url changes, building it again for performance reasons
  * building BDB with all relevant patches from MSYS2
  * drop GC install log step and therefore extra prefix
  * using msys-build instead of building Bison (only necessary for GC4)
  * drop extra CFLAGS previously necessary for local cJSON (fixed in 3.x)
  * enable NIST85 (+ comment-code in case we ever need to skip something there
    and/or ignoring failing NIST) --> as after last upstream update everything works
  * ci cache adjustment:
    * remove split per matrix
    * split per software, enabling smaller updates
  * use CI tarball like for the minimal build, drop flex+bison
  * drop workflow specific expected failures that now work fine
  * move env to MSYS job
  * resolve env vars by build API instead of runner
* integrate msys1.yml into ubuntu.yml, renaming to build_nightly.yml
* msys2:
  * split NIST + internal testsuite and run the later with less jobs to prevent hanging
  * split between "prepare" and "build" job, with the former generating a full distribution
    inclusive documentation, and the later having less packages installed,
    allowing to enable i386 again
  * disable BDB for 32bit build as MSYS2 doesn't provide that any more
  * switch cjson to json-c (more commonly used, MSYS2 still providing 32bit build)
  * explicit list of dependencies for configure
* msvc:
  * testsuite skip adjustments from the generated testsuite
  * enable building binary package and artifact
  * export dependencies and artifact

(cherry picked from commit 7d4a2fd772a6dc6e8de09bf3aeed02d1081c550d)
---
 .github/workflows/build_nightly.yml | 16 ++++--
 .github/workflows/macos.yml         | 68 +++++++++++------------
 .github/workflows/windows-msvc.yml  | 84 +++++++++++------------------
 .github/workflows/windows-msys2.yml | 10 ++--
 4 files changed, 82 insertions(+), 96 deletions(-)

diff --git a/.github/workflows/build_nightly.yml b/.github/workflows/build_nightly.yml
index b22a266ca..87d69ca2a 100644
--- a/.github/workflows/build_nightly.yml
+++ b/.github/workflows/build_nightly.yml
@@ -2,9 +2,9 @@ name: Build, Test and provide Nightly (Ubuntu + MSYS1)
 
 on:
 
-  pull_request:
-    branches: [ gc4 ]
-  push:
+  #pull_request:
+  #  branches: [ gc4 ]
+  #push:
   # manual run in actions tab - for all branches
   workflow_dispatch:
 
@@ -344,7 +344,7 @@ jobs:
       # M4: m4
       MSYSTEM: MINGW32
       MSYSPKGS: msys-m4 msys-coreutils msys-patch
-      #MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man msys-bison msys-patch  GC3 from VCS
+      #MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man msys-bison msys-patch  GC4 from VCS
       #MINGW_AUTOCONF_VERS: 2.7.0   # only needed to build from VCS, not from dist tarball
       #MINGW_BISON_VERS: bison-3.6  # minimal for GC 4.x+
       MINGW_GMP_VERS: gmp-6.3.0     # always update for performance reasons
@@ -602,10 +602,15 @@ jobs:
 
 
       - name: get cJSON
+        shell: cmd
         run: |
           curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v${{ env.MINGW_CJSON_VERS }}/cJSON.c -o .\libcob\cJSON.c
           curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v${{ env.MINGW_CJSON_VERS }}/cJSON.h -o .\libcob\cJSON.h
 
+          rem  to be dropped after merging the adjustment in configure.ac
+          mkdir _build\libcob
+          copy .\libcob\cJSON.* _build\libcob\
+
 
       # - name: Bootstrap GnuCOBOL
       #   run: |
@@ -664,6 +669,7 @@ jobs:
 
       - name: Run testsuite
         shell: cmd
+        continue-on-error: true   # dirty approach until merging leads to less errors (currently 18!) is finished
         run: |
           rem skip test as it sometimes works and sometimes not...
           rem instead of
@@ -680,7 +686,7 @@ jobs:
 
           rem to work around regular hangs we run NIST first, then the internal
           rem and the later only with 2 jobs
-          bash -lc "CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--jobs=2\""
+          bash -lc "CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--jobs=2\" || CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--recheck --verbose\"" 
           rem  Note: the extra CPATH above is only required in debug builds (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
 
       - name: Upload testsuite-${{ matrix.target }}.log
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index a1a43b55a..87babed79 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -1,9 +1,9 @@
 name: MacOS Workflow 4
 
 on:
-  pull_request:
-    branches: [ gc4 ]
-  push:
+  #pull_request:
+  #  branches: [ gc4 ]
+  # push:
   # manual run in actions tab - for all branches
   workflow_dispatch:
 
@@ -59,21 +59,21 @@ jobs:
 
       - 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: |
+          mkdir _build
           cd _build
           ../configure --with-${{ matrix.isam }} \
                        --with-indexed=${{ matrix.isam }} \
                        --enable-cobc-internal-checks \
                        --enable-hardening \
-                       --prefix /opt/cobol/gnucobol4-gcos \
-                       CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality" \
-                       CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH"
+                       --prefix /opt/cobol/gnucobol4 \
+                       CFLAGS="-Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS" \
+                       CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
 
       - name: make
         run: |
@@ -83,7 +83,7 @@ jobs:
         uses: actions/upload-artifact@v4
         if: failure()
         with:
-          name: config-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: config.log ${{ matrix.os }}-${{ matrix.isam }}
           path: _build/config.log
 
       # make install must be done before make check, otherwise
@@ -92,33 +92,38 @@ jobs:
       - name: make install
         run: |
           sudo make -C _build install
-          find /opt/cobol > _build/install.log
+          # find /opt/cobol > _build/install.log
 
-      - name: Upload install-${{ matrix.os }}-${{ matrix.isam }}.log
-        uses: actions/upload-artifact@v4
-        with:
-          name: install-${{ matrix.os }}-${{ matrix.isam }}.log
-          path: _build/install.log
+      #- name: Upload install.log
+      #  uses: actions/upload-artifact@v4
+      #  with:
+      #    name: install.log ${{ matrix.os }}-${{ matrix.isam }}
+      #    path: _build/install.log
+
+      - name: adjust test expectations for non V-ISAM
+        if: ${{ matrix.isam != 'visam' }}
+        run: |
+          sed -i '' '/run_file/{N;/INDEXED file SUPPRESS WHEN ALL/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
+          sed -i '' '/run_file/{N;/EXTFH: using ISAM callback/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
+          # marks all of those as expected failures
+          #sed -i '' '/run_file/{N;/trace feature/{N;N;N;N;s/traceon/traceon; echo "workflow:3">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
+          #sed -i '' '/run_file/{N;/trace feature with subroutine/{N;N;N;N;s/traceon/traceon; echo "workflow:4">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
+          #sed -i '' '/run_file/{N;/trace feature with indexed EXTFH/{N;N;N;N;s/traceon/traceon; echo "workflow:5">"$at_check_line_file"; at_fn_check_skip 77/;};}' tests/testsuite
+          sed -i '' '/run_file/{N;/trace feature/{N;s/at_xfail=no/at_xfail=yes/;};}' tests/testsuite
+
+          make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \
+            make -C _build check TESTSUITEFLAGS="--recheck --verbose"
 
       - name: check
         run: |
-          # skip tests that don't work yet - FIXME
-          # instead of
-          #    sed -i '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
-          # use
-          sed -i '/run_file/{N;/INDEXED file SUPPRESS WHEN ALL/{N;N;N;N;s/traceon/traceon; echo "workflow:1">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
-          sed -i '/run_file/{N;/EXTFH: using ISAM callback/{N;N;N;N;s/traceon/traceon; echo "workflow:2">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
-          sed -i '/run_file/{N;/"trace feature"/{N;N;N;N;s/traceon/traceon; echo "workflow:3">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
-          sed -i '/run_file/{N;/trace feature with subroutine/{N;N;N;N;s/traceon/traceon; echo "workflow:4">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
-          sed -i '/run_file/{N;/trace feature with indexed EXTFH/{N;N;N;N;s/traceon/traceon; echo "workflow:5">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
-
-          make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
-
-      - name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+          make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \
+            make -C _build check TESTSUITEFLAGS="--recheck --verbose"
+
+      - name: Upload internal Test Suite results
         uses: actions/upload-artifact@v4
         if: ${{ ! cancelled() }}  #-> always upload as build result documentation
         with:
-          name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: testsuite.log ${{ matrix.os }}-${{ matrix.isam }}
           path: _build/tests/testsuite.log
 
       - name: Cache newcob.val
@@ -129,11 +134,6 @@ jobs:
           save-always: true
           enableCrossOsArchive: true
 
-#      - name: NIST85 Test Suite
-#        run: |
-#          make -C _build/tests/cobol85 EXEC85 test              \
-#                         --jobs=$((${NPROC}+1))
-
       - name: Run NIST85 testsuite
         run: |
           make -C _build/tests test --jobs=$((${NPROC}+1))
@@ -142,7 +142,7 @@ jobs:
         if: ${{ ! cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
         with:
-          name: NIST85 results on ${{ matrix.os }}
+          name: NIST85 results on ${{ matrix.os }}-${{ matrix.isam }}
           path: |
             _build/tests/cobol85/summary.*
             _build/tests/cobol85/**/*.log
diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml
index c45304519..95bc5a67e 100644
--- a/.github/workflows/windows-msvc.yml
+++ b/.github/workflows/windows-msvc.yml
@@ -1,8 +1,8 @@
-name: Windows MSVC (build only)
+name: Windows MSVC
 
 on:
-  pull_request:
-    branches: [ gc4 ]
+  #pull_request:
+  #  branches: [ gc4 ]
   push:
   # manual run in actions tab - for all branches
   workflow_dispatch:
@@ -44,10 +44,10 @@ jobs:
 
     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: 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
@@ -151,44 +151,6 @@ jobs:
         run: |
           pacman --needed --noconfirm -S $MSYSPKGS
 
-      - name: Adjust testsuite
-        shell: C:\shells\msys2bash.cmd {0}
-        run: |
-          cd tests
-
-          sed -i '/AT_SETUP(\[Compare FLOAT-LONG with floating-point literal\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
-          sed -i '/AT_SETUP(\[Numeric operations (3) PACKED-DECIMAL\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
-          sed -i '/AT_SETUP(\[Numeric operations (7)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
-          sed -i '/AT_SETUP(\[integer arithmetic on floating-point var\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_fundamental.at
-          sed -i '/AT_SETUP(\[FLOAT-DECIMAL w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
-          sed -i '/AT_SETUP(\[FLOAT-SHORT \/ FLOAT-LONG w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
-          sed -i '/AT_SETUP(\[FLOAT-LONG with SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
-          sed -i '/AT_SETUP(\[FUNCTION ANNUITY\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
-          sed -i '/AT_SETUP(\[FUNCTION INTEGER\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
-          sed -i '/AT_SETUP(\[FUNCTION MOD (valid)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
-          sed -i '/AT_SETUP(\[FUNCTION SECONDS-FROM-FORMATTED-TIME\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_functions.at
-          sed -i '/AT_SETUP(\[GCOS floating-point usages\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_extensions.at
-          sed -i '/AT_SETUP(\[BINARY: 64bit unsigned arithmetic notrunc\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_binary.at
-          sed -i '/AT_SETUP(\[DISPLAY: ADD and SUBTRACT w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_display.at
-          sed -i '/AT_SETUP(\[DISPLAY: ADD and SUBTRACT, all ROUNDED MODEs\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_display.at
-          sed -i '/AT_SETUP(\[BCD ADD and SUBTRACT w\/o SIZE ERROR\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_packed.at
-          sed -i '/AT_SETUP(\[BCD ADD and SUBTRACT, all ROUNDED MODEs\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/data_packed.at
-          sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at
-
-        # Skip two tests that behave differently (fail or hand) under MSVC Debug
-        # - System routine CBL_GC_HOSTED: fails because libcob is linked with the debug version
-        #   of the C runtime while the generated module is linked with the release version
-        # - PROGRAM COLLATING SEQUENCE: fails because of a data loss in a cast, due
-        #   to lack of specific handling of LOW/HIGH-VALUE for NATIONAL alphabets
-        #   (see typeck.c:cb_validate_collating)
-      - name: Adjust testsuite for Debug target
-        if: ${{ matrix.target == 'Debug' }}
-        shell: C:\shells\msys2bash.cmd {0}
-        run: |
-          cd tests
-          sed -i '/AT_SETUP(\[System routine CBL_GC_HOSTED\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_extensions.at
-          sed -i '/AT_SETUP(\[PROGRAM COLLATING SEQUENCE\])/a AT_SKIP_IF(\[true\])' testsuite.src/syn_definition.at
-
       - name: Build testsuite
         shell: C:\shells\msys2bash.cmd {0}
         run: |
@@ -216,6 +178,24 @@ jobs:
           # sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/run_misc.at
           sed -i '/run_misc/{N;/write to internal storage (1)/{N;N;N;N;s/traceon/traceon; echo "workflow:1">"$at_check_line_file"; at_fn_check_skip 77/;}}' tests/testsuite
 
+          # sed -i '/run_fundamental/{N;/Compare FLOAT-LONG with floating-point litera/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_fundamental/{N;/Numeric operations (3) PACKED-DECIMAL/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_fundamental/{N;/Numeric operations (7)/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_fundamental/{N;/integer arithmetic on floating-point var/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_misc/{N;/FLOAT-DECIMAL w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_misc/{N;/FLOAT-SHORT \/ FLOAT-LONG w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_misc/{N;/FLOAT-LONG with SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_functions/{N;/FUNCTION ANNUITY/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_functions/{N;/FUNCTION INTEGER/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_functions/{N;/FUNCTION MOD (valid)/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_functions/{N;/FUNCTION SECONDS-FROM-FORMATTED-TIME/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/run_extensions/{N;/GCOS floating-point usages/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/data_binary/{N;/BINARY: 64bit unsigned arithmetic notrunc/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/data_display/{N;/DISPLAY: ADD and SUBTRACT w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/data_display/{N;/DISPLAY: ADD and SUBTRACT, all ROUNDED MODEs/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/data_packed/{N;/BCD ADD and SUBTRACT w\/o SIZE ERROR/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          # sed -i '/data_packed/{N;/BCD ADD and SUBTRACT, all ROUNDED MODEs/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+
         # Fail two tests that behave differently under MSVC Debug
         # - System routine CBL_GC_HOSTED: fails because libcob is linked with the debug version
         #   of the C runtime while the generated module is linked with the release version
@@ -226,20 +206,21 @@ jobs:
         if: ${{ matrix.target == 'Debug' }}
         shell: C:\shells\msys2bash.cmd {0}
         run: |
+          #sed -i '/run_extensions/{N;/System routine CBL_GC_HOSTED/{N;N;N;N;s/traceon/traceon; echo \"workflow:1d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
+          #sed -i '/syn_definition/{N;/PROGRAM COLLATING SEQUENCE/{N;N;N;N;s/traceon/traceon; echo \"workflow:2d\">\"$at_check_line_file\"; at_fn_check_skip 77/;}}' tests/testsuite
           sed -i '/run_extensions/{N;/System routine CBL_GC_HOSTED/{N;s/at_xfail=no/at_xfail=yes/;}}' tests/testsuite
           sed -i '/syn_definition/{N;/PROGRAM COLLATING SEQUENCE/{N;s/at_xfail=no/at_xfail=yes/;}}' tests/testsuite
 
       - name: Run testsuite
-        continue-on-error: true
+        shell: cmd
         run: |
-          set CL=/I "${{ env.VCPKG_ROOT }}\installed\${{ matrix.arch }}-windows\include"
+          set CL=
           call "%VCVARS%"
-          pushd ..\bin
-          cobc -x gcdiff.c
-          popd
+          set
           set MSYS2_PATH_TYPE=inherit
           cd tests
-          C:\shells\msys2bash.cmd -c "./testsuite || ./testsuite --recheck --verbose"
+          C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && cd ../bin && cobc -vvv -x gcdiff.c"
+          C:\shells\msys2bash.cmd -c "./testsuite --jobs=2 || ./testsuite --recheck --verbose"
 
       - name: Upload testsuite-${{ matrix.arch }}-${{ matrix.target }}.log
         uses: actions/upload-artifact@v4
@@ -260,7 +241,6 @@ jobs:
           7z.exe a -r -mx=9 dependencies-${{ matrix.arch }}.7z "%VCPKG_EXPORT_DIR%"
 
           echo wrap up GnuCBOBOL binary package
-          rem set CL=
           cmd /C build_windows\makedist.cmd ${{ matrix.target }} <NUL
           
       - name: Upload dependencies
diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml
index 32f7c2f7b..cdfd090a8 100644
--- a/.github/workflows/windows-msys2.yml
+++ b/.github/workflows/windows-msys2.yml
@@ -1,9 +1,9 @@
-name: Windows MSYS2 (build only)
+name: Windows MSYS2
 
 on:
-  pull_request:
-    branches: [ gc4 ]
-  push:
+  #pull_request:
+  #  branches: [ gc4 ]
+  #push:
   # manual run in actions tab - for all branches
   workflow_dispatch:
 
@@ -184,7 +184,7 @@ jobs:
           # and the later only with 2 jobs
           # make -C _build/tests checkall TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
           make -C _build/tests check TESTSUITEFLAGS="--jobs=2" || \
-          make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
+           make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
 
       - name: Upload testsuite-${{matrix.sys}}-${{matrix.target}}.log
         uses: actions/upload-artifact@v4