From 7dd97a776523b6c4e48940693e98ea957189bded Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 2 Oct 2021 10:36:37 +0300 Subject: [PATCH] mswin gh actions #27: try2add error handling --- .github/workflows/windows-x64.yml | 163 +++++++++-------- .github/workflows/windows-x86.yml | 168 ++++++++++-------- .../translate-travis.yml-to-github-actions.py | 4 +- 3 files changed, 190 insertions(+), 145 deletions(-) diff --git a/.github/workflows/windows-x64.yml b/.github/workflows/windows-x64.yml index 0a642cbb6..029e741c7 100644 --- a/.github/workflows/windows-x64.yml +++ b/.github/workflows/windows-x64.yml @@ -48,159 +48,180 @@ jobs: SET PY3MODS=cffi freecell_solver pycotap pysol_cards random2 six - dir + dir || ( echo Failed & exit /B 1 ) - cd + cd || ( echo Failed & exit /B 1 ) - c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" + c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed + & exit /B 1 ) - c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" + c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed + & exit /B 1 ) - choco install ag + choco install ag || ( echo Failed & exit /B 1 ) - if not exist C:\libtap mkdir C:\libtap + if not exist C:\libtap mkdir C:\libtap || ( echo Failed & exit /B + 1 ) - copy c:\Python35-x64\python.exe c:\Python35-x64\python3.exe + copy c:\Python35-x64\python.exe c:\Python35-x64\python3.exe || ( echo + Failed & exit /B 1 ) - python3 -mpip install %PY3MODS% + python3 -mpip install %PY3MODS% || ( echo Failed & exit /B 1 ) - perl -v + perl -v || ( echo Failed & exit /B 1 ) copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe + || ( echo Failed & exit /B 1 ) - SET PERL5LIB=C:/_P5/lib/perl5 + SET PERL5LIB=C:/_P5/lib/perl5 || ( echo Failed & exit /B 1 ) - SET PERL_LOCAL_LIB_ROOT=C:/_P5 + SET PERL_LOCAL_LIB_ROOT=C:/_P5 || ( echo Failed & exit /B 1 ) - SET PERL_MB_OPT=--install_base C:/_P5 + SET PERL_MB_OPT=--install_base C:/_P5 || ( echo Failed & exit /B 1 + ) - SET PERL_MM_OPT=INSTALL_BASE=C:/_P5 + SET PERL_MM_OPT=INSTALL_BASE=C:/_P5 || ( echo Failed & exit /B 1 ) - perl -v + perl -v || ( echo Failed & exit /B 1 ) curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz + || ( echo Failed & exit /B 1 ) - copy C:\libtap\gperf-3.0.4.tar.gz . + copy C:\libtap\gperf-3.0.4.tar.gz . || ( echo Failed & exit /B 1 ) - tar -xvf gperf-3.0.4.tar.gz + tar -xvf gperf-3.0.4.tar.gz || ( echo Failed & exit /B 1 ) cd gperf-3.0.4 && perl -e "if (-e qq#C:\\libtap\\bin\\gperf.exe#) { exit(0); } $ENV{PATH} = qq#C:\\msys64\\mingw64\\bin;$ENV{PATH}#; system(''sh configure --prefix=C:/libtap'') or system(''gmake'') or - system(''gmake install'');" && cd .. + system(''gmake install'');" && cd .. || ( echo Failed & exit /B 1 + ) - git clone https://github.com/clibs/cmocka libtap + git clone https://github.com/clibs/cmocka libtap || ( echo Failed + & exit /B 1 ) - mkdir libtap\b + mkdir libtap\b || ( echo Failed & exit /B 1 ) - cd libtap\b + cd libtap\b || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap .. + -DCMAKE_INSTALL_PREFIX=C:\libtap .. || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - cd ..\..\ + cd ..\..\ || ( echo Failed & exit /B 1 ) - git clone https://github.com/shlomif/rinutils rinutils + git clone https://github.com/shlomif/rinutils rinutils || ( echo Failed + & exit /B 1 ) - mkdir rinutils\b + mkdir rinutils\b || ( echo Failed & exit /B 1 ) - cd rinutils\b + cd rinutils\b || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap .. + -DCMAKE_INSTALL_PREFIX=C:\libtap .. || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - SET MYOLDPATH_=%PATH% + SET MYOLDPATH_=%PATH% || ( echo Failed & exit /B 1 ) - mkdir ..\b32 + mkdir ..\b32 || ( echo Failed & exit /B 1 ) - cd ..\b32 + cd ..\b32 || ( echo Failed & exit /B 1 ) cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. + -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. || ( echo Failed & exit /B 1 + ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - SET PATH=%MYOLDPATH_% + SET PATH=%MYOLDPATH_% || ( echo Failed & exit /B 1 ) - cd ..\..\ + cd ..\..\ || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) - set LIBRARY_PATH=C:\libtap\lib + set LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 ) - set CMAKE_LIBRARY_PATH=C:\libtap\lib + set CMAKE_LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 + ) - set CMAKE_PREFIX_PATH=C:/libtap;c:/libtap32 + set CMAKE_PREFIX_PATH=C:/libtap;c:/libtap32 || ( echo Failed & exit + /B 1 ) - set LD_LIBRARY_PATH=C:\libtap\lib + set LD_LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 ) - set PKG_CONFIG_PATH=C:\libtap\lib\pkgconfig; + set PKG_CONFIG_PATH=C:\libtap\lib\pkgconfig; || ( echo Failed & exit + /B 1 ) - dir c:\libtap /s + dir c:\libtap /s || ( echo Failed & exit /B 1 ) - set CPATH=C:\libtap\include + set CPATH=C:\libtap\include || ( echo Failed & exit /B 1 ) - set PATH=C:\libtap\bin;%PATH% + set PATH=C:\libtap\bin;%PATH% || ( echo Failed & exit /B 1 ) - del c:\msys64\mingw64\bin\python*.exe + del c:\msys64\mingw64\bin\python*.exe || ( echo Failed & exit /B 1 + ) - set HARNESS_BREAK=1 + set HARNESS_BREAK=1 || ( echo Failed & exit /B 1 ) - set FCS_USE_TEST_RUN=1 + set FCS_USE_TEST_RUN=1 || ( echo Failed & exit /B 1 ) - mkdir fc-solve\b + mkdir fc-solve\b || ( echo Failed & exit /B 1 ) - cd fc-solve\b + cd fc-solve\b || ( echo Failed & exit /B 1 ) perl ../scripts/Tatzer -G "MinGW Makefiles" -l x64t --dbm=kaztree + || ( echo Failed & exit /B 1 ) - SET PATH=C:\projects\fc-solve\fc-solve\scripts\win32;%PATH% + SET PATH=C:\projects\fc-solve\fc-solve\scripts\win32;%PATH% || ( echo + Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake boards + gmake boards || ( echo Failed & exit /B 1 ) - perl ../source/run-tests.pl + perl ../source/run-tests.pl || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - SET CC=cc + SET CC=cc || ( echo Failed & exit /B 1 ) - SET CXX=c++ + SET CXX=c++ || ( echo Failed & exit /B 1 ) - cd .. + cd .. || ( echo Failed & exit /B 1 ) - mkdir pkg-build-win64 + mkdir pkg-build-win64 || ( echo Failed & exit /B 1 ) - cd pkg-build-win64 + cd pkg-build-win64 || ( echo Failed & exit /B 1 ) - perl ../scripts/Tatzer -G "MinGW Makefiles" --notest-suite -r + perl ../scripts/Tatzer -G "MinGW Makefiles" --notest-suite -r || ( + echo Failed & exit /B 1 ) - gmake package + gmake package || ( echo Failed & exit /B 1 ) - cpack -G WIX + cpack -G WIX || ( echo Failed & exit /B 1 ) ' shell: cmd diff --git a/.github/workflows/windows-x86.yml b/.github/workflows/windows-x86.yml index 982144b46..6244a8e6a 100644 --- a/.github/workflows/windows-x86.yml +++ b/.github/workflows/windows-x86.yml @@ -48,166 +48,188 @@ jobs: SET PY3MODS=cffi freecell_solver pycotap pysol_cards random2 six - dir + dir || ( echo Failed & exit /B 1 ) - cd + cd || ( echo Failed & exit /B 1 ) - c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" + c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed + & exit /B 1 ) - c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" + c:\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" || ( echo Failed + & exit /B 1 ) - choco install ag + choco install ag || ( echo Failed & exit /B 1 ) - if not exist C:\libtap mkdir C:\libtap + if not exist C:\libtap mkdir C:\libtap || ( echo Failed & exit /B + 1 ) - copy c:\Python35-x64\python.exe c:\Python35-x64\python3.exe + copy c:\Python35-x64\python.exe c:\Python35-x64\python3.exe || ( echo + Failed & exit /B 1 ) - python3 -mpip install %PY3MODS% + python3 -mpip install %PY3MODS% || ( echo Failed & exit /B 1 ) - perl -v + perl -v || ( echo Failed & exit /B 1 ) copy C:\msys64\mingw64\bin\mingw32-make.exe C:\msys64\mingw64\bin\make.exe + || ( echo Failed & exit /B 1 ) - SET PERL5LIB=C:/_P5/lib/perl5 + SET PERL5LIB=C:/_P5/lib/perl5 || ( echo Failed & exit /B 1 ) - SET PERL_LOCAL_LIB_ROOT=C:/_P5 + SET PERL_LOCAL_LIB_ROOT=C:/_P5 || ( echo Failed & exit /B 1 ) - SET PERL_MB_OPT=--install_base C:/_P5 + SET PERL_MB_OPT=--install_base C:/_P5 || ( echo Failed & exit /B 1 + ) - SET PERL_MM_OPT=INSTALL_BASE=C:/_P5 + SET PERL_MM_OPT=INSTALL_BASE=C:/_P5 || ( echo Failed & exit /B 1 ) - perl -v + perl -v || ( echo Failed & exit /B 1 ) curl -o C:\libtap\gperf-3.0.4.tar.gz http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz + || ( echo Failed & exit /B 1 ) - copy C:\libtap\gperf-3.0.4.tar.gz . + copy C:\libtap\gperf-3.0.4.tar.gz . || ( echo Failed & exit /B 1 ) - tar -xvf gperf-3.0.4.tar.gz + tar -xvf gperf-3.0.4.tar.gz || ( echo Failed & exit /B 1 ) cd gperf-3.0.4 && perl -e "if (-e qq#C:\\libtap\\bin\\gperf.exe#) { exit(0); } $ENV{PATH} = qq#C:\\msys64\\mingw64\\bin;$ENV{PATH}#; system(''sh configure --prefix=C:/libtap'') or system(''gmake'') or - system(''gmake install'');" && cd .. + system(''gmake install'');" && cd .. || ( echo Failed & exit /B 1 + ) - git clone https://github.com/clibs/cmocka libtap + git clone https://github.com/clibs/cmocka libtap || ( echo Failed + & exit /B 1 ) - mkdir libtap\b + mkdir libtap\b || ( echo Failed & exit /B 1 ) - cd libtap\b + cd libtap\b || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap .. + -DCMAKE_INSTALL_PREFIX=C:\libtap .. || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - cd ..\..\ + cd ..\..\ || ( echo Failed & exit /B 1 ) - git clone https://github.com/shlomif/rinutils rinutils + git clone https://github.com/shlomif/rinutils rinutils || ( echo Failed + & exit /B 1 ) - mkdir rinutils\b + mkdir rinutils\b || ( echo Failed & exit /B 1 ) - cd rinutils\b + cd rinutils\b || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap .. + -DCMAKE_INSTALL_PREFIX=C:\libtap .. || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - SET MYOLDPATH_=%PATH% + SET MYOLDPATH_=%PATH% || ( echo Failed & exit /B 1 ) - mkdir ..\b32 + mkdir ..\b32 || ( echo Failed & exit /B 1 ) - cd ..\b32 + cd ..\b32 || ( echo Failed & exit /B 1 ) cmake -G "MinGW Makefiles" -DWITH_TEST_SUITE=OFF -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM% - -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. + -DCMAKE_INSTALL_PREFIX=C:\libtap32 .. || ( echo Failed & exit /B 1 + ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - SET PATH=%MYOLDPATH_% + SET PATH=%MYOLDPATH_% || ( echo Failed & exit /B 1 ) - cd ..\..\ + cd ..\..\ || ( echo Failed & exit /B 1 ) - set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe + set CMAKE_MAKE_PROGRAM=C:\strawberry\c\bin\gmake.exe || ( echo Failed + & exit /B 1 ) - set LIBRARY_PATH=C:\libtap\lib + set LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 ) - set CMAKE_LIBRARY_PATH=C:\libtap\lib + set CMAKE_LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 + ) - set CMAKE_PREFIX_PATH=C:/libtap;c:/libtap32 + set CMAKE_PREFIX_PATH=C:/libtap;c:/libtap32 || ( echo Failed & exit + /B 1 ) - set LD_LIBRARY_PATH=C:\libtap\lib + set LD_LIBRARY_PATH=C:\libtap\lib || ( echo Failed & exit /B 1 ) - set PKG_CONFIG_PATH=C:\libtap\lib\pkgconfig; + set PKG_CONFIG_PATH=C:\libtap\lib\pkgconfig; || ( echo Failed & exit + /B 1 ) - dir c:\libtap /s + dir c:\libtap /s || ( echo Failed & exit /B 1 ) - set CPATH=C:\libtap\include + set CPATH=C:\libtap\include || ( echo Failed & exit /B 1 ) - set PATH=C:\libtap\bin;%PATH% + set PATH=C:\libtap\bin;%PATH% || ( echo Failed & exit /B 1 ) - del c:\msys64\mingw64\bin\python*.exe + del c:\msys64\mingw64\bin\python*.exe || ( echo Failed & exit /B 1 + ) - set HARNESS_BREAK=1 + set HARNESS_BREAK=1 || ( echo Failed & exit /B 1 ) - set FCS_USE_TEST_RUN=1 + set FCS_USE_TEST_RUN=1 || ( echo Failed & exit /B 1 ) - mkdir fc-solve\b + mkdir fc-solve\b || ( echo Failed & exit /B 1 ) - cd fc-solve\b + cd fc-solve\b || ( echo Failed & exit /B 1 ) perl ../scripts/Tatzer -G "MinGW Makefiles" -l x64t --dbm=kaztree + || ( echo Failed & exit /B 1 ) - SET PATH=C:\projects\fc-solve\fc-solve\scripts\win32;%PATH% + SET PATH=C:\projects\fc-solve\fc-solve\scripts\win32;%PATH% || ( echo + Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - gmake + gmake || ( echo Failed & exit /B 1 ) - gmake boards + gmake boards || ( echo Failed & exit /B 1 ) - perl ../source/run-tests.pl + perl ../source/run-tests.pl || ( echo Failed & exit /B 1 ) - echo %PATH% + echo %PATH% || ( echo Failed & exit /B 1 ) - SET CC=cc + SET CC=cc || ( echo Failed & exit /B 1 ) - SET CXX=c++ + SET CXX=c++ || ( echo Failed & exit /B 1 ) - cd .. + cd .. || ( echo Failed & exit /B 1 ) - mkdir pkg-build + mkdir pkg-build || ( echo Failed & exit /B 1 ) - cd pkg-build + cd pkg-build || ( echo Failed & exit /B 1 ) perl ../scripts/Tatzer -G "MinGW Makefiles" --notest-suite -r --dbm=none + || ( echo Failed & exit /B 1 ) - gmake package + gmake package || ( echo Failed & exit /B 1 ) - cpack -G WIX + cpack -G WIX || ( echo Failed & exit /B 1 ) perl ../scripts/Tatzer -G "MinGW Makefiles" -l pysol_defs --notest-suite - -r --prefix=c:\fcs-pysol --dbm=none + -r --prefix=c:\fcs-pysol --dbm=none || ( echo Failed & exit /B 1 ) - gmake install + gmake install || ( echo Failed & exit /B 1 ) - 7z a fc-solve-for-pysol.zip c:/fcs-pysol + 7z a fc-solve-for-pysol.zip c:/fcs-pysol || ( echo Failed & exit /B + 1 ) ' shell: cmd diff --git a/fc-solve/CI-testing/translate-travis.yml-to-github-actions.py b/fc-solve/CI-testing/translate-travis.yml-to-github-actions.py index 7c95e2d16..03d33cc77 100644 --- a/fc-solve/CI-testing/translate-travis.yml-to-github-actions.py +++ b/fc-solve/CI-testing/translate-travis.yml-to-github-actions.py @@ -192,7 +192,9 @@ def _calc_batch_code(cmds): cmd) else: r = cmd - batch += r + "\n" + # See: + # https://serverfault.com/questions/157173 + batch += r + " || ( echo Failed & exit /B 1 )" + "\n" return batch if 0: