@@ -57,7 +57,58 @@ permissions:
5757 contents : read
5858
5959jobs :
60+ build-tarball :
61+ if : github.event.pull_request.draft == false
62+ runs-on : ubuntu-24.04-arm
63+ steps :
64+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+ if : ${{ github.event_name != 'workflow_dispatch' }}
66+ with :
67+ persist-credentials : false
68+
69+ - uses : cachix/install-nix-action@f0fe604f8a612776892427721526b4c7cfb23aba # v31
70+ if : ${{ github.event_name != 'workflow_dispatch' }}
71+ with :
72+ extra_nix_config : sandbox = true
73+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
74+ nix_path : nixpkgs=${{ env.NIXPKGS_REPO }}/archive/${{ env.NIXPKGS_PIN }}.tar.gz
75+
76+ - uses : cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
77+ if : ${{ github.event_name != 'workflow_dispatch' }}
78+ with :
79+ name : nodejs
80+ authToken : ${{ secrets.CACHIX_AUTH_TOKEN }}
81+
82+ - name : Make tarball
83+ if : ${{ github.event_name != 'workflow_dispatch' }}
84+ run : |
85+ export DATESTRING=$(date "+%Y-%m-%d")
86+ export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
87+ nix-shell \
88+ --pure --keep DISTTYPE --keep DATESTRING --keep COMMIT \
89+ --arg loadJSBuiltinsDynamically false \
90+ --arg ccache 'null' \
91+ --arg icu 'null' \
92+ --arg devTools '[]' \
93+ --arg benchmarkTools '[]' \
94+ --arg sharedLibDeps '{}' \
95+ --run '
96+ ./configure && make tar -j8 SKIP_XZ=1 SKIP_SHARED_DEPS=1
97+ '
98+ env :
99+ DISTTYPE : nightly
100+
101+
102+ - name : Upload tarball artifact
103+ if : ${{ github.event_name != 'workflow_dispatch' }}
104+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
105+ with :
106+ name : tarballs
107+ path : ' *.tar.gz'
108+ compression-level : 0
109+
60110 build :
111+ needs : build-tarball
61112 strategy :
62113 fail-fast : false
63114 matrix :
@@ -73,10 +124,17 @@ jobs:
73124 name : ' ${{ matrix.system }}: with shared libraries'
74125 runs-on : ${{ matrix.runner }}
75126 steps :
76- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
77128 if : ${{ github.event_name != 'workflow_dispatch' }}
78129 with :
79- persist-credentials : false
130+ name : tarballs
131+ path : tarballs
132+
133+ - name : Extract tarball
134+ if : ${{ github.event_name != 'workflow_dispatch' }}
135+ run : |
136+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
137+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
80138
81139 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82140 if : ${{ github.event_name == 'workflow_dispatch' }}
@@ -116,23 +174,22 @@ jobs:
116174
117175 - name : Patch npm gyp (to be able to build addons for the tests)
118176 if : ${{ github.event_name != 'workflow_dispatch' }}
119- run : curl -L https://github.com/npm/cli/pull/8531.diff | git apply --directory=deps/npm --exclude=deps/npm/package-lock.json
177+ run : curl -L https://github.com/npm/cli/pull/8531.diff | git apply --directory="$TAR_DIR/ deps/npm" --exclude="$TAR_DIR/ deps/npm/package-lock.json"
120178
121179 - name : Load shell.nix
122- if : ${{ github.event_name == 'workflow_dispatch' }}
123180 run : curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix
124181
125182 - name : Build Node.js ${{ github.event_name == 'workflow_dispatch' && 'on the base commit' || 'and run tests' }}
126183 run : |
127184 nix-shell \
128- --pure --keep FLAKY_TESTS \
185+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
129186 --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
130187 --arg loadJSBuiltinsDynamically false \
131188 --arg ccache '(import <nixpkgs> {}).sccache' \
132189 --arg devTools '[]' \
133190 --arg benchmarkTools '[]' \
134191 --run '
135- make ${{ github.event_name == 'workflow_dispatch' && 'build' || 'run' }}-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
192+ make ${{ github.event_name == 'workflow_dispatch' && 'build' || '-C "$TAR_DIR" run' }}-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
136193 '
137194
138195 - name : Re-build Node.js on the merge commit
0 commit comments