38
38
gcc-version : " 13"
39
39
test-amalgamation : true
40
40
41
+ - os : ubuntu-latest
42
+ description : " Emscripten"
43
+ emscripten-version : " 3.1.52"
44
+ # needs:
45
+ # - use emscripten's cmake toolchain file so cmake uses em++ and such
46
+ # - must compile with -pthread for C++11 threads to work
47
+ #
48
+ # See https://emscripten.org/docs/porting/pthreads.html
49
+ #
50
+ # poolSTL test-suite specific options:
51
+ # - using -sNO_DISABLE_EXCEPTION_CATCHING because some tests throw
52
+ # - using high -sTOTAL_MEMORY because our benchmarks use large arrays
53
+ # - disable codecov because emscripten does not support it.
54
+ # - Consider -DCMAKE_EXE_LINKER_FLAGS="-sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency"
55
+ cmake-flags : ' -DCMAKE_TOOLCHAIN_FILE=$(em-config EMSCRIPTEN_ROOT)/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CXX_FLAGS="-pthread -sNO_DISABLE_EXCEPTION_CATCHING" -DCMAKE_EXE_LINKER_FLAGS="-sTOTAL_MEMORY=2048MB" -DPOOLSTL_TEST_COVERAGE=OFF'
56
+
41
57
- os : ubuntu-latest
42
58
# default GCC, which has gcov
43
59
82
98
version : ${{ matrix.llvm-version }}
83
99
env : true
84
100
101
+ - name : Setup Emscripten
102
+ uses : mymindstorm/setup-emsdk@v14
103
+ if : ${{ matrix.emscripten-version != '' }}
104
+ with :
105
+ version : ${{ matrix.emscripten-version }}
106
+
107
+ # Default node.js (v18) does not support threads well.
108
+ # It might work with --experimental-wasm-threads --experimental-wasm-bulk-memory
109
+ # but newer node just works out of the box.
110
+ - name : Setup node.js for running Emscripten builds
111
+ uses : actions/setup-node@v4
112
+ if : ${{ matrix.emscripten-version != '' }}
113
+ with :
114
+ node-version : 21
115
+
85
116
- name : Setup cmake
86
117
uses : jwlawson/actions-setup-cmake@v1
87
118
if : ${{ matrix.cmake-version != '' }}
95
126
cd build/tests
96
127
ctest -C Debug --output-on-failure --verbose
97
128
echo "Supplement Test:"
98
- ./supplement_test || ./Debug/supplement_test.exe
129
+ ./supplement_test || ./Debug/supplement_test.exe || node supplement_test
99
130
shell : bash
100
131
101
132
- name : Benchmark
@@ -105,7 +136,7 @@ jobs:
105
136
cmake -S . -B bench_build/ -DCMAKE_BUILD_TYPE=Release -DPOOLSTL_BENCH=ON ${{ matrix.cmake-flags }}
106
137
cmake --build bench_build/ --config Release
107
138
cd bench_build/benchmark/
108
- ./poolstl_bench || ./Release/poolstl_bench.exe
139
+ ./poolstl_bench || ./Release/poolstl_bench.exe || node poolstl_bench
109
140
shell : bash
110
141
111
142
- name : Test Amalgamation
0 commit comments