@@ -57,7 +57,36 @@ permissions:
5757 contents : read
5858
5959jobs :
60+ build-tarball :
61+ if : github.event.pull_request.draft == false
62+ name : ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
63+ runs-on : ubuntu-24.04-arm
64+ steps :
65+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
66+ if : ${{ github.event_name != 'workflow_dispatch' }}
67+ with :
68+ persist-credentials : false
69+
70+ - name : Make tarball
71+ if : ${{ github.event_name != 'workflow_dispatch' }}
72+ run : |
73+ export DATESTRING=$(date "+%Y-%m-%d")
74+ export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
75+ ./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
76+ env :
77+ DISTTYPE : nightly
78+
79+
80+ - name : Upload tarball artifact
81+ if : ${{ github.event_name != 'workflow_dispatch' }}
82+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
83+ with :
84+ name : tarballs
85+ path : ' *.tar.gz'
86+ compression-level : 0
87+
6088 build :
89+ needs : build-tarball
6190 strategy :
6291 fail-fast : false
6392 matrix :
@@ -73,10 +102,24 @@ jobs:
73102 name : ' ${{ matrix.system }}: with shared libraries'
74103 runs-on : ${{ matrix.runner }}
75104 steps :
76- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
77106 if : ${{ github.event_name != 'workflow_dispatch' }}
78107 with :
79- persist-credentials : false
108+ name : tarballs
109+ path : tarballs
110+
111+ - name : Extract tarball
112+ if : ${{ github.event_name != 'workflow_dispatch' }}
113+ run : |
114+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
115+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
116+
117+ - name : Patch npm gyp (to be able to build addons for the tests)
118+ if : ${{ github.event_name != 'workflow_dispatch' }}
119+ run : |
120+ cd "$TAR_DIR"
121+ curl -L https://github.com/npm/cli/pull/8531.diff \
122+ | git apply --directory=deps/npm --exclude=deps/npm/package-lock.json
80123
81124 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82125 if : ${{ github.event_name == 'workflow_dispatch' }}
@@ -113,26 +156,25 @@ jobs:
113156 core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
114157 core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
115158 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
120159
121160 - name : Load shell.nix
122- if : ${{ github.event_name == 'workflow_dispatch' }}
123- run : curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix
161+ run : |
162+ ${{ github.event_name == 'workflow_dispatch' &&
163+ 'curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix'
164+ || 'mv "$TAR_DIR/shell.nix" .'
165+ }}
124166
125167 - name : Build Node.js ${{ github.event_name == 'workflow_dispatch' && 'on the base commit' || 'and run tests' }}
126168 run : |
127169 nix-shell \
128- --pure --keep FLAKY_TESTS \
170+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
129171 --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
130172 --arg loadJSBuiltinsDynamically false \
131173 --arg ccache '(import <nixpkgs> {}).sccache' \
132174 --arg devTools '[]' \
133175 --arg benchmarkTools '[]' \
134176 --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"
177+ 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"
136178 '
137179
138180 - name : Re-build Node.js on the merge commit
0 commit comments