Skip to content

Commit 396a07a

Browse files
authored
tools: implements a few nits on build-aarch64-linux-v8
Rename things, and merge some steps. Signed-off-by: Antoine du Hamel <[email protected]> PR-URL: #63048 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7eab492 commit 396a07a

1 file changed

Lines changed: 16 additions & 23 deletions

File tree

.github/workflows/test-shared.yml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ jobs:
173173
outputs:
174174
local-cache: ${{ steps.upload.outcome != 'skipped' && 'true' || '' }}
175175
matrix: ${{ steps.query.outputs.matrix }}
176+
env:
177+
HAS_CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN && 'true' }}
176178
steps:
177179
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
178180
with:
@@ -189,58 +191,49 @@ jobs:
189191
with:
190192
extra_nix_config: sandbox = true
191193

192-
- name: Evaluate V8 derivation
194+
- name: Evaluate V8 derivation, check its cache status
193195
id: v8-drv
194196
run: |
195197
V8_DRV=$(
196198
nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/shell.nix { useSeparateDerivationForV8=true; }).buildInputs"
197199
)
200+
V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV")
198201
echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT"
199-
echo "STORE_PATH=$(nix-store -q --outputs "$V8_DRV")" >> "$GITHUB_OUTPUT"
200-
201-
- name: Check if available on Cachix
202-
id: cachix-check
203-
run: |
204-
echo 'HAS_WRITE_TOKEN=${{ secrets.CACHIX_AUTH_TOKEN && 'true' }}' >> "$GITHUB_OUTPUT"
205202
set -x
206203
[ "$(curl -ISsw "%{http_code}" -o /dev/null "https://nodejs.cachix.org/$(basename ${V8_STORE_PATH%-v8-*}).narinfo")" != "200" ] ||
207204
echo "ALREADY_CACHED=true" >> "$GITHUB_OUTPUT"
208-
env:
209-
V8_STORE_PATH: ${{ steps.v8-drv.outputs.STORE_PATH }}
210205
211206
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
212-
if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' }}
207+
if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }}
213208
with:
214209
name: nodejs
215210
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
216211

217-
- name: Build V8 derivation
218-
if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' }}
219-
run: nix-store --export "$(nix-build "$V8_DRV")" > libv8
212+
- name: Build V8 to cache it
213+
if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' }}
214+
run: nix-store --export "$(nix-build "$V8_DRV")" > libv8-aarch64-linux.nar
220215
env:
221216
V8_DRV: ${{ steps.v8-drv.outputs.V8_DRV }}
222217

223-
- name: Upload libv8
224-
if: ${{ steps.cachix-check.outputs.ALREADY_CACHED != 'true' && steps.cachix-check.outputs.HAS_WRITE_TOKEN != 'true' }}
218+
- name: Upload libv8-aarch64-linux.nar
219+
if: ${{ steps.v8-drv.outputs.ALREADY_CACHED != 'true' && env.HAS_CACHIX_AUTH_TOKEN != 'true' }}
225220
id: upload
226221
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
227222
with:
228-
name: libv8
229-
path: libv8
223+
name: libv8-aarch64-linux.nar
224+
path: libv8-aarch64-linux.nar
230225

231226
- name: Collect matrix of support OpenSSL versions
232227
id: query
233228
run: |
234-
{
235-
echo 'matrix<<EOF'
229+
echo "matrix=$(
236230
nix-instantiate --eval --strict --json -E "
237231
let
238232
matrix = import $TAR_DIR/tools/nix/openssl-matrix.nix {};
239233
in
240234
builtins.map (attr: { inherit attr; inherit (builtins.getAttr attr matrix) name; }) (builtins.attrNames matrix)
241235
"
242-
echo 'EOF'
243-
} >> "$GITHUB_OUTPUT"
236+
)" >> "$GITHUB_OUTPUT"
244237
245238
# Builds and tests Node.js with shared libraries against every supported
246239
# OpenSSL release version available in the repo-pinned nixpkgs. The default
@@ -268,7 +261,7 @@ jobs:
268261
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
269262
if: ${{ needs.build-aarch64-linux-v8.outputs.local-cache }}
270263
with:
271-
name: libv8
264+
name: libv8-aarch64-linux.nar
272265

273266
- uses: ./.github/actions/build-shared
274267
name: Build and test Node.js
@@ -281,7 +274,7 @@ jobs:
281274
# release (e.g. `openssl-1.1.1w`) so EOL-with-extended-support
282275
# cycles evaluate without relaxing nixpkgs' meta check globally.
283276
extra-nix-flags: |
284-
--arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8)"' || 'true' }} \
277+
--arg useSeparateDerivationForV8 ${{ needs.build-aarch64-linux-v8.outputs.local-cache && '"$(nix-store --import < libv8-aarch64-linux.nar)"' || 'true' }} \
285278
--arg sharedLibDeps "(import $TAR_DIR/tools/nix/sharedLibDeps.nix {}) // {
286279
openssl = (import $TAR_DIR/tools/nix/openssl-matrix.nix {}).$OPENSSL_ATTR;
287280
}" \

0 commit comments

Comments
 (0)