Skip to content

Commit 682b9a8

Browse files
committed
tools: add temporary shared openssl workflow
Signed-off-by: Filip Skokan <[email protected]>
1 parent aacf750 commit 682b9a8

4 files changed

Lines changed: 129 additions & 3 deletions

File tree

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Throwaway workflow used solely to gather test results for Node.js
2+
# linked against OpenSSL 3.5, 3.6, and 4.0.
3+
name: TEMP - Test Shared libraries (OpenSSL)
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- tmp-openssl4
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
env:
16+
FLAKY_TESTS: keep_retrying
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build-tarball:
23+
name: Build slim tarball
24+
runs-on: ubuntu-slim
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
persist-credentials: false
29+
30+
- name: Make tarball
31+
run: |
32+
export DATESTRING=$(date "+%Y-%m-%d")
33+
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
34+
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
35+
env:
36+
DISTTYPE: nightly
37+
38+
- name: Upload tarball artifact
39+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
40+
with:
41+
name: tarballs
42+
path: '*.tar.gz'
43+
compression-level: 0
44+
45+
build:
46+
needs: build-tarball
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
opensslPkg:
51+
- openssl_1_1
52+
- openssl_3
53+
- openssl_3_5
54+
- openssl_3_6
55+
- openssl_4_0
56+
system:
57+
- x86_64-linux
58+
- aarch64-linux
59+
- x86_64-darwin
60+
- aarch64-darwin
61+
include:
62+
- system: x86_64-linux
63+
runner: ubuntu-24.04
64+
- system: aarch64-linux
65+
runner: ubuntu-24.04-arm
66+
- system: x86_64-darwin
67+
runner: macos-15-intel
68+
- system: aarch64-darwin
69+
runner: macos-latest
70+
name: '${{ matrix.system }}: with shared libraries (${{ matrix.opensslPkg }})'
71+
runs-on: ${{ matrix.runner }}
72+
# We only care about the test results here, not about gating anything.
73+
continue-on-error: true
74+
steps:
75+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
76+
with:
77+
name: tarballs
78+
path: tarballs
79+
80+
- name: Extract tarball
81+
run: |
82+
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
83+
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
84+
85+
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
86+
with:
87+
extra_nix_config: sandbox = true
88+
89+
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
90+
with:
91+
name: nodejs
92+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
93+
94+
- name: Configure sccache
95+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
96+
with:
97+
script: |
98+
core.exportVariable('SCCACHE_GHA_ENABLED', 'on');
99+
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
100+
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
101+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
102+
core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache');
103+
104+
- name: Build Node.js and run tests
105+
env:
106+
# Allow evaluating packages marked insecure in nixpkgs (e.g. openssl_1_1).
107+
NIXPKGS_ALLOW_INSECURE: '1'
108+
run: |
109+
nix-shell \
110+
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
111+
--impure \
112+
--pure --keep TAR_DIR --keep FLAKY_TESTS --keep NIXPKGS_ALLOW_INSECURE \
113+
--keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
114+
--arg loadJSBuiltinsDynamically false \
115+
--arg useSeparateDerivationForV8 true \
116+
--arg ccache "${NIX_SCCACHE:-null}" \
117+
--arg devTools '[]' \
118+
--arg benchmarkTools '[]' \
119+
--arg opensslPkg '(import <nixpkgs> {}).${{ matrix.opensslPkg }}' \
120+
${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg withFFI false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }}
121+
--run '
122+
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
123+
' "$TAR_DIR/shell.nix"

shell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
withFFI ? true,
2020
withSSL ? true,
2121
withTemporal ? false,
22+
opensslPkg ? pkgs.openssl_3_5,
2223
sharedLibDeps ? (
2324
import ./tools/nix/sharedLibDeps.nix {
2425
inherit
@@ -29,6 +30,7 @@
2930
withFFI
3031
withSSL
3132
withTemporal
33+
opensslPkg
3234
;
3335
}
3436
),

tools/nix/pkgs.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
arg:
22
let
33
repo = "https://github.com/NixOS/nixpkgs";
4-
rev = "13043924aaa7375ce482ebe2494338e058282925";
4+
rev = "ec9a189b46ab91b00e19c8e4abe55d6af792e43d";
55
nixpkgs = import (builtins.fetchTarball {
66
url = "${repo}/archive/${rev}.tar.gz";
7-
sha256 = "1pbv1c3syp94rh147s2nhbzfcib01blz3s7g290m43s3nk71404z";
7+
sha256 = "1s42s1na2r6dhs25dcpfs8gl9xw31ajg4wj7h9jskn0ml7ksw6wc";
88
}) arg;
99
in
1010
nixpkgs

tools/nix/sharedLibDeps.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
withSSL ? true,
77
withFFI ? true,
88
withTemporal ? false,
9+
opensslPkg ? pkgs.openssl_3_5,
910
}:
1011
{
1112
inherit (pkgs)
@@ -51,7 +52,7 @@
5152
ffi = pkgs.libffiReal;
5253
})
5354
// (pkgs.lib.optionalAttrs withSSL ({
54-
openssl = pkgs.openssl_3_5;
55+
openssl = opensslPkg;
5556
}))
5657
// (pkgs.lib.optionalAttrs withTemporal {
5758
inherit (pkgs) temporal_capi;

0 commit comments

Comments
 (0)