|
47 | 47 | - vcbuild.bat |
48 | 48 | - .** |
49 | 49 | - '!.github/workflows/test-shared.yml' |
| 50 | + - '!.github/actions/build-shared/**' |
50 | 51 | types: [opened, synchronize, reopened, ready_for_review] |
51 | 52 | push: |
52 | 53 | branches: |
|
97 | 98 | - vcbuild.bat |
98 | 99 | - .** |
99 | 100 | - '!.github/workflows/test-shared.yml' |
| 101 | + - '!.github/actions/build-shared/**' |
100 | 102 |
|
101 | 103 | concurrency: |
102 | 104 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
103 | 105 | cancel-in-progress: true |
104 | 106 |
|
105 | 107 | env: |
106 | 108 | FLAKY_TESTS: keep_retrying |
| 109 | + # Latest OpenSSL major.minor cycle we support running tests with. |
| 110 | + # The nixpkgs updater regenerates the OpenSSL matrix using this value. |
| 111 | + SUPPORTED_OPENSSL_VERSION: '4.0' |
107 | 112 |
|
108 | 113 | permissions: |
109 | 114 | contents: read |
@@ -153,50 +158,68 @@ jobs: |
153 | 158 | name: '${{ matrix.system }}: with shared libraries' |
154 | 159 | runs-on: ${{ matrix.runner }} |
155 | 160 | steps: |
156 | | - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 161 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
157 | 162 | if: ${{ github.event_name != 'workflow_dispatch' }} |
158 | 163 | with: |
159 | | - name: tarballs |
160 | | - path: tarballs |
161 | | - |
162 | | - - name: Extract tarball |
| 164 | + persist-credentials: false |
| 165 | + sparse-checkout: .github/actions |
| 166 | + - uses: ./.github/actions/build-shared |
163 | 167 | if: ${{ github.event_name != 'workflow_dispatch' }} |
164 | | - run: | |
165 | | - tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP" |
166 | | - echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV" |
167 | | -
|
168 | | - - uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3 |
169 | 168 | with: |
170 | | - extra_nix_config: sandbox = true |
| 169 | + system: ${{ matrix.system }} |
| 170 | + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} |
171 | 171 |
|
172 | | - - uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17 |
| 172 | + # Builds the matrix for `build-openssl` from tools/nix/openssl-matrix.json. |
| 173 | + # Output shape: |
| 174 | + # [{ "version": "3.6.1", "attr": "openssl_3_6", "continue-on-error": false }, ...] |
| 175 | + collect-openssl-versions: |
| 176 | + if: github.event.pull_request.draft == false |
| 177 | + runs-on: ubuntu-slim |
| 178 | + outputs: |
| 179 | + matrix: ${{ steps.query.outputs.matrix }} |
| 180 | + steps: |
| 181 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
173 | 182 | with: |
174 | | - name: nodejs |
175 | | - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 183 | + persist-credentials: false |
| 184 | + sparse-checkout: tools/nix |
| 185 | + sparse-checkout-cone-mode: false |
| 186 | + - id: query |
| 187 | + run: | |
| 188 | + matrix=$(jq -c . tools/nix/openssl-matrix.json) |
| 189 | + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" |
176 | 190 |
|
177 | | - - name: Configure sccache |
178 | | - if: github.base_ref == 'main' || github.ref_name == 'main' |
179 | | - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 |
| 191 | + # Builds and tests Node.js with shared libraries against every supported |
| 192 | + # OpenSSL release version available in the repo-pinned nixpkgs. The default |
| 193 | + # shared `openssl` from tools/nix/sharedLibDeps.nix is overridden per matrix |
| 194 | + # entry, while all other shared libs remain at their defaults. Only runs on |
| 195 | + # a single runner/system (aarch64-linux) to keep the matrix to a minimum. |
| 196 | + build-openssl: |
| 197 | + needs: |
| 198 | + - build-tarball |
| 199 | + - collect-openssl-versions |
| 200 | + strategy: |
| 201 | + fail-fast: false |
| 202 | + matrix: |
| 203 | + openssl: ${{ fromJSON(needs.collect-openssl-versions.outputs.matrix) }} |
| 204 | + name: 'aarch64-linux: with shared ${{ matrix.openssl.attr }} (${{ matrix.openssl.version }})' |
| 205 | + runs-on: ubuntu-24.04-arm |
| 206 | + continue-on-error: ${{ matrix.openssl['continue-on-error'] }} |
| 207 | + env: |
| 208 | + OPENSSL_ATTR: ${{ matrix.openssl.attr }} |
| 209 | + OPENSSL_VERSION: ${{ matrix.openssl.version }} |
| 210 | + steps: |
| 211 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
180 | 212 | with: |
181 | | - script: | |
182 | | - core.exportVariable('SCCACHE_GHA_ENABLED', 'on'); |
183 | | - core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); |
184 | | - core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || ''); |
185 | | - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); |
186 | | - core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache'); |
187 | | -
|
188 | | - - name: Build Node.js and run tests |
189 | | - run: | |
190 | | - nix-shell \ |
191 | | - -I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \ |
192 | | - --pure --keep TAR_DIR --keep FLAKY_TESTS \ |
193 | | - --keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \ |
194 | | - --arg loadJSBuiltinsDynamically false \ |
195 | | - --arg useSeparateDerivationForV8 true \ |
196 | | - --arg ccache "${NIX_SCCACHE:-null}" \ |
197 | | - --arg devTools '[]' \ |
198 | | - --arg benchmarkTools '[]' \ |
199 | | - ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg withFFI false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }} |
200 | | - --run ' |
201 | | - make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" |
202 | | - ' "$TAR_DIR/shell.nix" |
| 213 | + persist-credentials: false |
| 214 | + sparse-checkout: .github/actions |
| 215 | + - uses: ./.github/actions/build-shared |
| 216 | + with: |
| 217 | + system: aarch64-linux |
| 218 | + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 219 | + # Override just the `openssl` attr of the default shared-lib set with |
| 220 | + # the matrix-selected nixpkgs attribute (e.g. `openssl_3_6`). All |
| 221 | + # other shared libs (brotli, cares, libuv, …) keep their defaults. |
| 222 | + # `permittedInsecurePackages` whitelists just the matrix-selected |
| 223 | + # release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support |
| 224 | + # cycles evaluate without relaxing nixpkgs' meta check globally. |
| 225 | + extra-nix-args: --arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // { openssl = (import $TAR_DIR/tools/nix/pkgs.nix { config.permittedInsecurePackages = [ \"openssl-$OPENSSL_VERSION\" ]; }).$OPENSSL_ATTR; }" |
0 commit comments