Files
node/.github/workflows/build-shared.yml
T
dependabot[bot] 2f7c7ec6a0 meta: bump cachix/cachix-action
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 5f2d7c5294214f71b873db4b969586b980625e71 to 38b082610b782e7e93e209c35fd730d399dee866.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Changelog](https://github.com/cachix/cachix-action/blob/master/RELEASE.md)
- [Commits](https://github.com/cachix/cachix-action/compare/5f2d7c5294214f71b873db4b969586b980625e71...38b082610b782e7e93e209c35fd730d399dee866)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-version: 38b082610b782e7e93e209c35fd730d399dee866
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/66047
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-09-18 00:03:23 +00:00

97 lines
3.3 KiB
YAML

name: Build Node.js (shared libraries)
on:
workflow_call:
inputs:
runner:
description: The runner to use for the job.
required: true
type: string
extra-nix-flags:
description: Additional CLI arguments appended to the nix-shell invocation.
required: false
type: string
default: ''
with-sccache:
description: Whether to enable sccache
required: false
type: boolean
default: false
v8-nar:
description: An optional name for the NAR archive for V8 that needs to be downloaded
required: false
type: string
default: ''
pkcs11-store-test:
description: Whether to enable the PKCS#11-backed crypto STORE test
required: false
type: boolean
default: false
secrets:
CACHIX_AUTH_TOKEN:
description: Cachix auth token for nodejs.cachix.org.
required: false
permissions: {}
env:
FLAKY_TESTS: keep_retrying
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: tarballs
pattern: '*.tar.gz'
merge-multiple: true
- name: Extract tarball
shell: bash
run: |
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
with:
extra_nix_config: sandbox = true
- uses: cachix/cachix-action@38b082610b782e7e93e209c35fd730d399dee866 # v17
with:
name: nodejs
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: inputs.v8-nar
with:
name: ${{ inputs.v8-nar }}
- name: Configure sccache
if: inputs.with-sccache
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
core.exportVariable('SCCACHE_GHA_ENABLED', 'on');
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache');
- name: Build Node.js and run tests
shell: bash
run: |
nix-shell \
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
--pure --keep TAR_DIR --keep FLAKY_TESTS \
--keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
--arg loadJSBuiltinsDynamically false \
--arg ccache "${NIX_SCCACHE:-null}" \
--arg devTools '[]' \
--arg benchmarkTools '[]' \
--arg pkcs11 ${{ inputs.pkcs11-store-test }} \
${{ inputs.extra-nix-flags }} \
--run '
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
' "$TAR_DIR/shell.nix"