@@ -200,3 +200,99 @@ jobs:
200200 --run '
201201 make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
202202 ' "$TAR_DIR/shell.nix"
203+
204+ # Builds the matrix for the `build-openssl` job. The logic lives in
205+ # tools/nix/collect-openssl-matrix.sh.
206+ # Output shape:
207+ # [{ "version": "3.6", "attr": "openssl_3_6", "continue-on-error": false }, ...]
208+ collect-openssl-versions :
209+ if : github.event.pull_request.draft == false
210+ runs-on : ubuntu-slim
211+ outputs :
212+ matrix : ${{ steps.query.outputs.matrix }}
213+ steps :
214+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
215+ with :
216+ persist-credentials : false
217+ sparse-checkout : tools/nix
218+ sparse-checkout-cone-mode : false
219+ - uses : cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
220+ with :
221+ extra_nix_config : sandbox = true
222+ - id : query
223+ env :
224+ # Latest OpenSSL release we support running tests with. Anything
225+ # newer runs with continue-on-error in `build-openssl`.
226+ SUPPORTED_OPENSSL_VERSION : ' 4.0'
227+ run : |
228+ matrix=$(./tools/nix/collect-openssl-matrix.sh)
229+ echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
230+
231+ # Builds and tests Node.js with shared libraries against every supported
232+ # OpenSSL release version available in the repo-pinned nixpkgs. The default
233+ # shared `openssl` from tools/nix/sharedLibDeps.nix is overridden per matrix
234+ # entry, while all other shared libs remain at their defaults. Only runs on
235+ # a single runner/system (x86_64-linux) to keep the matrix to a minimum.
236+ build-openssl :
237+ needs :
238+ - build-tarball
239+ - collect-openssl-versions
240+ strategy :
241+ fail-fast : false
242+ matrix :
243+ openssl : ${{ fromJSON(needs.collect-openssl-versions.outputs.matrix) }}
244+ name : ' x86_64-linux: with shared ${{ matrix.openssl.attr }} (${{ matrix.openssl.version }})'
245+ runs-on : ubuntu-24.04
246+ continue-on-error : ${{ matrix.openssl['continue-on-error'] }}
247+ steps :
248+ - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
249+ with :
250+ name : tarballs
251+ path : tarballs
252+
253+ - name : Extract tarball
254+ run : |
255+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
256+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
257+
258+ - uses : cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
259+ with :
260+ extra_nix_config : sandbox = true
261+
262+ - uses : cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
263+ with :
264+ name : nodejs
265+ authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
266+
267+ - name : Configure sccache
268+ if : github.base_ref == 'main' || github.ref_name == 'main'
269+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
270+ with :
271+ script : |
272+ core.exportVariable('SCCACHE_GHA_ENABLED', 'on');
273+ core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
274+ core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
275+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
276+ core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache');
277+
278+ - name : Build Node.js and run tests
279+ env :
280+ OPENSSL_ATTR : ${{ matrix.openssl.attr }}
281+ run : |
282+ # Same invocation as the `build` job, except `--arg sharedLibDeps`
283+ # overrides the `openssl` attr of the default shared-lib set with
284+ # the matrix-selected nixpkgs attribute (e.g. `openssl_3_6`). All
285+ # other shared libs (brotli, cares, libuv, …) keep their defaults.
286+ nix-shell \
287+ -I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
288+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
289+ --keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
290+ --arg loadJSBuiltinsDynamically false \
291+ --arg useSeparateDerivationForV8 true \
292+ --arg ccache "${NIX_SCCACHE:-null}" \
293+ --arg devTools '[]' \
294+ --arg benchmarkTools '[]' \
295+ --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { openssl = (import $TAR_DIR/tools/nix/pkgs.nix {}).$OPENSSL_ATTR; }" \
296+ --run '
297+ make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
298+ ' "$TAR_DIR/shell.nix"
0 commit comments