@@ -2,9 +2,11 @@ name: CI
22
33on :
44 push :
5- branches : [main]
5+ branches :
6+ - main
67 pull_request :
7- branches : [main]
8+ branches :
9+ - main
810
911defaults :
1012 run :
@@ -42,32 +44,37 @@ jobs:
4244 runs-on : ${{ matrix.os }}
4345 strategy :
4446 matrix :
47+ node-version :
48+ - ' 24.10.0'
49+ rust-version :
50+ - ' stable'
4551 os :
4652 - windows-latest
4753 - ubuntu-latest
54+ - macos-latest
4855 steps :
4956 - uses : actions/checkout@v4
5057
5158 - name : Cache Splicer build
5259 uses : actions/cache@v4
5360 id : splicer-build
5461 with :
55- key : splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
62+ key : splicer-${{ matrix.os }}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
5663 path : |
5764 lib
5865 target
5966
6067 - name : Install Rust Toolchain
6168 if : steps.splicer-build.outputs.cache-hit != 'true'
6269 run : |
63- rustup toolchain install 1.80.0
64- rustup target add wasm32-wasip1 --toolchain 1.80.0
70+ rustup toolchain install ${{ matrix.rust-version }}
71+ rustup target add wasm32-wasip1 --toolchain ${{ matrix.rust-version }}
6572 rustup target add wasm32-wasip1
6673
67- - uses : actions/setup-node@v4
74+ - uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
6875 if : steps.splicer-build.outputs.cache-hit != 'true'
6976 with :
70- node-version : ' 23.10.0 '
77+ node-version : ${{ matrix.node-version }}
7178
7279 - name : Install NPM packages
7380 if : steps.splicer-build.outputs.cache-hit != 'true'
@@ -78,12 +85,20 @@ jobs:
7885 run : make lib/spidermonkey-embedding-splicer.js
7986
8087 build :
81- runs-on : ubuntu-latest
88+ runs-on : ${{ matrix.os }}
8289 needs :
8390 - build-splicer
8491 strategy :
8592 fail-fast : false
8693 matrix :
94+ node-version :
95+ - ' 24.10.0'
96+ rust-version :
97+ - ' stable'
98+ os :
99+ # NOTE: at present the build does *not* work on windows. Required binaries are built here
100+ # (only on linux) and reused in later steps
101+ - ubuntu-latest
87102 build-type :
88103 - ' release'
89104 - ' debug'
@@ -105,8 +120,8 @@ jobs:
105120 - name : Install Rust Toolchain
106121 if : steps.starlingmonkey-build.outputs.cache-hit != 'true'
107122 run : |
108- rustup toolchain install 1.80.0
109- rustup target add wasm32-wasip1 --toolchain 1.80.0
123+ rustup toolchain install ${{ matrix.rust-version }}
124+ rustup target add wasm32-wasip1 --toolchain ${{ matrix.rust-version }}
110125 rustup target add wasm32-wasip1
111126
112127 - name : Install wasm-tools
@@ -117,15 +132,15 @@ jobs:
117132 uses : actions/cache/restore@v4
118133 id : splicer-build
119134 with :
120- key : splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
135+ key : splicer-${{ matrix.os }}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
121136 path : |
122137 lib
123138 target
124139
125- - uses : actions/setup-node@v4
140+ - uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
126141 if : steps.starlingmonkey-build.outputs.cache-hit != 'true'
127142 with :
128- node-version : ' 23.10.0 '
143+ node-version : ${{ matrix.node-version }}
129144
130145 - name : Install NPM packages
131146 if : steps.starlingmonkey-build.outputs.cache-hit != 'true'
@@ -149,12 +164,11 @@ jobs:
149164 fail-fast : false
150165 matrix :
151166 node-version :
152- - ' 23 .10.0'
153- # - latest reenable when https://github.com/nodejs/node/issues/57172 is fixed
167+ - ' 24 .10.0'
168+ - latest # reenable when https://github.com/nodejs/node/issues/57172 is fixed
154169 os :
155170 - ubuntu-latest
156- # NOTE: windows-2025 (which is now latest) seems to hang on test runs
157- - windows-2022
171+ - windows-latest
158172 - macos-latest
159173 build-type :
160174 - ' release'
@@ -178,25 +192,32 @@ jobs:
178192 uses : actions/cache/restore@v4
179193 id : splicer-build
180194 with :
181- key : splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
195+ key : splicer-${{ matrix.os }}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
182196 path : |
183197 lib
184198 target
185199
186- - uses : actions/setup-node@v4
200+ - uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
187201 with :
188202 node-version : ${{matrix.node-version}}
189203
190204 - name : Install NPM packages
191205 run : npm install
192206
193207 - name : Test
194- run : npm run test:${{matrix.build-type}}
208+ run : |
209+ npm run test:${{matrix.build-type}}
195210
196211 test-example :
197- runs-on : ubuntu-latest
212+ runs-on : ${{ matrix.os }}
198213 needs :
199214 - build
215+ strategy :
216+ matrix :
217+ node-version :
218+ - ' 24.10.0'
219+ os :
220+ - ubuntu-latest
200221 steps :
201222 - uses : actions/checkout@v4
202223
@@ -215,14 +236,14 @@ jobs:
215236 uses : actions/cache/restore@v4
216237 id : splicer-build
217238 with :
218- key : splicer-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
239+ key : splicer-${{ matrix.os }}-${{ hashFiles('Cargo.lock', 'crates/spidermonkey-embedding-splicer/src/**/*.rs') }}
219240 path : |
220241 lib
221242 target
222243
223- - uses : actions/setup-node@v4
244+ - uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
224245 with :
225- node-version : ' 23.10.0 '
246+ node-version : ${{ matrix.node-version }}
226247
227248 - name : Install NPM packages
228249 run : npm install
0 commit comments