Skip to content

Commit 51e3395

Browse files
committed
tools: cache V8 builds
1 parent 5a877ec commit 51e3395

1 file changed

Lines changed: 84 additions & 7 deletions

File tree

.github/workflows/test-shared.yml

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,52 @@ jobs:
141141
path: '*.tar.gz'
142142
compression-level: 0
143143

144+
build-aarch64-linux-v8:
145+
needs: build-tarball
146+
runs-on: ubuntu-24.04-arm
147+
name: 'aarch64-linux: Cache V8 build'
148+
steps:
149+
- name: Check if Cachix is available
150+
id: cachix-check
151+
run: echo 'IS_AVAILABLE=${{ secrets.CACHIX_AUTH_TOKEN && 'true' }}' >> "$GITHUB_OUTPUT"
152+
153+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
154+
if: ${{ steps.cachix-check.outputs.IS_AVAILABLE == 'true' }}
155+
with:
156+
name: tarballs
157+
path: tarballs
158+
159+
- name: Extract tarball
160+
if: ${{ steps.cachix-check.outputs.IS_AVAILABLE == 'true' }}
161+
shell: bash
162+
run: |
163+
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
164+
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
165+
166+
- uses: cachix/install-nix-action@96951a368ba55167b55f1c916f7d416bac6505fe # v31.10.3
167+
if: ${{ steps.cachix-check.outputs.IS_AVAILABLE == 'true' }}
168+
with:
169+
extra_nix_config: sandbox = true
170+
171+
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
172+
if: ${{ steps.cachix-check.outputs.IS_AVAILABLE == 'true' }}
173+
with:
174+
name: nodejs
175+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
176+
177+
- name: Build V8
178+
if: ${{ steps.cachix-check.outputs.IS_AVAILABLE == 'true' }}
179+
shell: bash
180+
run: |
181+
nix-shell \
182+
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
183+
--pure \
184+
--arg useSeparateDerivationForV8 true \
185+
--arg ccache "${NIX_SCCACHE:-null}" \
186+
--arg devTools '[]' \
187+
--arg benchmarkTools '[]' \
188+
--run 'echo Done' "$TAR_DIR/shell.nix"
189+
144190
build:
145191
needs: build-tarball
146192
strategy:
@@ -149,8 +195,8 @@ jobs:
149195
include:
150196
- runner: ubuntu-24.04
151197
system: x86_64-linux
152-
- runner: ubuntu-24.04-arm
153-
system: aarch64-linux
198+
# - runner: ubuntu-24.04-arm
199+
# system: aarch64-linux
154200
- runner: macos-15-intel
155201
system: x86_64-darwin
156202
- runner: macos-latest
@@ -169,6 +215,34 @@ jobs:
169215
system: ${{ matrix.system }}
170216
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
171217

218+
build-aarch64-linux:
219+
needs: build-aarch64-linux-v8
220+
strategy:
221+
fail-fast: false
222+
matrix:
223+
include:
224+
# - runner: ubuntu-24.04
225+
# system: x86_64-linux
226+
- runner: ubuntu-24.04-arm
227+
system: aarch64-linux
228+
# - runner: macos-15-intel
229+
# system: x86_64-darwin
230+
# - runner: macos-latest
231+
# system: aarch64-darwin
232+
name: '${{ matrix.system }}: with shared libraries'
233+
runs-on: ${{ matrix.runner }}
234+
steps:
235+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
236+
if: ${{ github.event_name != 'workflow_dispatch' }}
237+
with:
238+
persist-credentials: false
239+
sparse-checkout: .github/actions
240+
- uses: ./.github/actions/build-shared
241+
if: ${{ github.event_name != 'workflow_dispatch' }}
242+
with:
243+
system: ${{ matrix.system }}
244+
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
245+
172246
# Builds the matrix for `build-openssl` from tools/nix/openssl-matrix.json.
173247
# Output shape:
174248
# [{ "version": "3.6.1", "attr": "openssl_3_6", "continue-on-error": false }, ...]
@@ -181,21 +255,24 @@ jobs:
181255
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
182256
with:
183257
persist-credentials: false
184-
sparse-checkout: tools/nix
258+
sparse-checkout: tools/nix/openssl-matrix.json
185259
sparse-checkout-cone-mode: false
186260
- id: query
187261
run: |
188-
matrix=$(jq -c . tools/nix/openssl-matrix.json)
189-
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
190-
262+
{
263+
echo 'matrix<<EOF'
264+
cat tools/nix/openssl-matrix.json
265+
echo 'EOF'
266+
} >> "$GITHUB_OUTPUT"
267+
191268
# Builds and tests Node.js with shared libraries against every supported
192269
# OpenSSL release version available in the repo-pinned nixpkgs. The default
193270
# shared `openssl` from tools/nix/sharedLibDeps.nix is overridden per matrix
194271
# entry, while all other shared libs remain at their defaults. Only runs on
195272
# a single runner/system (aarch64-linux) to keep the matrix to a minimum.
196273
build-openssl:
197274
needs:
198-
- build-tarball
275+
- build-aarch64-linux-v8
199276
- collect-openssl-versions
200277
strategy:
201278
fail-fast: false

0 commit comments

Comments
 (0)