@@ -57,7 +57,35 @@ 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+ - name : Make tarball
70+ if : ${{ github.event_name != 'workflow_dispatch' }}
71+ run : |
72+ export DATESTRING=$(date "+%Y-%m-%d")
73+ export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
74+ ./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
75+ env :
76+ DISTTYPE : nightly
77+
78+
79+ - name : Upload tarball artifact
80+ if : ${{ github.event_name != 'workflow_dispatch' }}
81+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
82+ with :
83+ name : tarballs
84+ path : ' *.tar.gz'
85+ compression-level : 0
86+
6087 build :
88+ needs : build-tarball
6189 strategy :
6290 fail-fast : false
6391 matrix :
@@ -73,10 +101,27 @@ jobs:
73101 name : ' ${{ matrix.system }}: with shared libraries'
74102 runs-on : ${{ matrix.runner }}
75103 steps :
76- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
77105 if : ${{ github.event_name != 'workflow_dispatch' }}
78106 with :
79- persist-credentials : false
107+ name : tarballs
108+ path : tarballs
109+ github-token : ${{ github.token }} # token with actions:read permissions on target repo
110+ repository : aduh95/node
111+ run-id : 17547305713
112+
113+ - name : Extract tarball
114+ if : ${{ github.event_name != 'workflow_dispatch' }}
115+ run : |
116+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
117+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
118+
119+ - name : Patch npm gyp (to be able to build addons for the tests)
120+ if : ${{ github.event_name != 'workflow_dispatch' }}
121+ run : |
122+ cd "$TAR_DIR"
123+ curl -L https://github.com/npm/cli/pull/8531.diff \
124+ | git apply --directory=deps/npm --exclude=deps/npm/package-lock.json
80125
81126 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82127 if : ${{ github.event_name == 'workflow_dispatch' }}
@@ -113,26 +158,21 @@ jobs:
113158 core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
114159 core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
115160 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
116-
117- - name : Patch npm gyp (to be able to build addons for the tests)
118- 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
120161
121162 - name : Load shell.nix
122- if : ${{ github.event_name == 'workflow_dispatch' }}
123163 run : curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix
124164
125165 - name : Build Node.js ${{ github.event_name == 'workflow_dispatch' && 'on the base commit' || 'and run tests' }}
126166 run : |
127167 nix-shell \
128- --pure --keep FLAKY_TESTS \
168+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
129169 --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
130170 --arg loadJSBuiltinsDynamically false \
131171 --arg ccache '(import <nixpkgs> {}).sccache' \
132172 --arg devTools '[]' \
133173 --arg benchmarkTools '[]' \
134174 --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"
175+ 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"
136176 '
137177
138178 - name : Re-build Node.js on the merge commit
0 commit comments