@@ -744,7 +744,6 @@ jobs:
744
744
if : ${{ runner.os == 'windows' }}
745
745
shell : powershell
746
746
run : |
747
- $ErrorActionPreference = "Stop"
748
747
micromamba create -f environment-wasm.yml --platform=emscripten-wasm32
749
748
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
750
749
.\emsdk\emsdk_env.ps1
@@ -822,7 +821,19 @@ jobs:
822
821
-DSYSROOT_PATH="$env:SYSROOT_PATH" `
823
822
..\
824
823
}
825
- emmake make -j ${{ env.ncpus }} check-cppinterop
824
+ function Error-OnFailure {
825
+ param (
826
+ [Parameter(Mandatory)]
827
+ [ScriptBlock]$Command
828
+ )
829
+
830
+ & $Command
831
+
832
+ if ($LASTEXITCODE -ne 0) {
833
+ exit $LASTEXITCODE
834
+ }
835
+ }
836
+ Error-OnFailure{ emmake make -j ${{ env.ncpus }} check-cppinterop }
826
837
cd .\unittests\CppInterOp\
827
838
Invoke-WebRequest -Uri "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win/1411573/chrome-win.zip" -OutFile "$PWD\chrome-win.zip" -Verbose
828
839
Expand-Archive -Path "$PWD\chrome-win.zip" -DestinationPath "$PWD" -Force -Verbose
@@ -832,23 +843,34 @@ jobs:
832
843
echo "PATH=$env:PATH"
833
844
echo "PATH=$env:PATH" >> $env:GITHUB_ENV
834
845
echo "Running CppInterOpTests in Firefox"
835
- emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" CppInterOpTests.html
846
+ Error-OnFailure { emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" CppInterOpTests.html }
836
847
echo "Running DynamicLibraryManagerTests in Firefox"
837
- emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" DynamicLibraryManagerTests.html
848
+ Error-OnFailure { emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" DynamicLibraryManagerTests.html }
838
849
echo "Running CppInterOpTests in Chromium"
839
- emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html
850
+ Error-OnFailure { emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html }
840
851
echo "Running DynamicLibraryManagerTests in Chromium"
841
- emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
852
+ Error-OnFailure { emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html }
842
853
cd ..\..
843
- emmake make -j ${{ env.ncpus }} install
854
+ Error-OnFailure { emmake make -j ${{ env.ncpus }} install }
844
855
845
856
- name : Build and Test/Install CppInterOp on Windows systems (static library)
846
857
if : ${{ runner.os == 'windows' }}
847
858
shell : powershell
848
859
run : |
849
- $ErrorActionPreference = "Stop"
850
860
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
851
861
.\emsdk\emsdk_env.ps1
862
+ function Error-OnFailure {
863
+ param (
864
+ [Parameter(Mandatory)]
865
+ [ScriptBlock]$Command
866
+ )
867
+
868
+ & $Command
869
+
870
+ if ($LASTEXITCODE -ne 0) {
871
+ exit $LASTEXITCODE
872
+ }
873
+ }
852
874
$env:PWD_DIR= $PWD.Path
853
875
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
854
876
$env:PREFIX="%CONDA_PREFIX%/envs/CppInterOp-wasm"
@@ -921,16 +943,16 @@ jobs:
921
943
-DSYSROOT_PATH="$env:SYSROOT_PATH" `
922
944
..\
923
945
}
924
- emmake make -j ${{ env.ncpus }} check-cppinterop
946
+ Error-OnFailure { emmake make -j ${{ env.ncpus }} check-cppinterop }
925
947
cd .\unittests\CppInterOp\
926
948
echo "Running CppInterOpTests in Firefox"
927
- emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" CppInterOpTests.html
949
+ Error-OnFailure { emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" CppInterOpTests.html }
928
950
echo "Running DynamicLibraryManagerTests in Firefox"
929
- emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" DynamicLibraryManagerTests.html
951
+ Error-OnFailure { emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" DynamicLibraryManagerTests.html }
930
952
echo "Running CppInterOpTests in Chromium"
931
- emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html
953
+ Error-OnFailure { emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html }
932
954
echo "Running DynamicLibraryManagerTests in Chromium"
933
- emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
955
+ Error-OnFailure{ emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html }
934
956
935
957
- name : Build xeus-cpp
936
958
if : ${{ runner.os != 'windows' }}
0 commit comments