@@ -59,7 +59,46 @@ permissions:
5959 contents : read
6060
6161jobs :
62+ build-tarball :
63+ if : github.event.pull_request.draft == false
64+ name : ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
65+ runs-on : ubuntu-24.04-arm
66+ steps :
67+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
68+ if : ${{ github.event_name != 'workflow_dispatch' }}
69+ with :
70+ persist-credentials : false
71+
72+ - name : Patch npm gyp (to be able to build addons for the tests)
73+ if : ${{ github.event_name != 'workflow_dispatch' }}
74+ run : |
75+ curl -L https://github.com/nodejs/gyp-next/commit/8224deef984add7e7afe846cfb82c9d3fa6da1fb.diff \
76+ | git apply --directory=deps/npm/node_modules/node-gyp/gyp
77+ git add deps/npm/node_modules/node-gyp/gyp
78+ git config --local user.email "[email protected] " 79+ git config --local user.name "Node.js GitHub Bot"
80+ git commit --fixup HEAD
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+ ./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
88+ env :
89+ DISTTYPE : nightly
90+
91+
92+ - name : Upload tarball artifact
93+ if : ${{ github.event_name != 'workflow_dispatch' }}
94+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
95+ with :
96+ name : tarballs
97+ path : ' *.tar.gz'
98+ compression-level : 0
99+
62100 build :
101+ needs : build-tarball
63102 strategy :
64103 fail-fast : false
65104 matrix :
@@ -75,10 +114,17 @@ jobs:
75114 name : ' ${{ matrix.system }}: with shared libraries'
76115 runs-on : ${{ matrix.runner }}
77116 steps :
78- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
117+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
79118 if : ${{ github.event_name != 'workflow_dispatch' }}
80119 with :
81- persist-credentials : false
120+ name : tarballs
121+ path : tarballs
122+
123+ - name : Extract tarball
124+ if : ${{ github.event_name != 'workflow_dispatch' }}
125+ run : |
126+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
127+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
82128
83129 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
84130 if : ${{ github.event_name == 'workflow_dispatch' }}
@@ -109,30 +155,28 @@ jobs:
109155 core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
110156 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
111157
158+ - name : Load shell.nix
159+ if : github.event_name != 'workflow_dispatch'
160+ run : mv "$TAR_DIR"/*.nix .
161+
112162 - name : Load shell.nix
113163 if : github.event_name == 'workflow_dispatch'
114164 run : |
115165 [ -f shell.nix ] || curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix
116166 [ -f nixpkgs.nix ] || curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/nixpkgs.nix
117167
118- - name : Patch npm gyp
119- if : github.event_name != 'workflow_dispatch'
120- run : |
121- curl -L https://github.com/nodejs/gyp-next/commit/8224deef984add7e7afe846cfb82c9d3fa6da1fb.diff \
122- | git apply --directory=deps/npm/node_modules/node-gyp/gyp
123-
124168 - name : Build Node.js ${{ github.event_name == 'workflow_dispatch' && 'on the base commit' || 'and run tests' }}
125169 run : |
126170 nix-shell \
127171 -I nixpkgs=./nixpkgs.nix \
128- --pure --keep FLAKY_TESTS \
172+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
129173 --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
130174 --arg loadJSBuiltinsDynamically false \
131175 --arg ccache '(import <nixpkgs> {}).sccache' \
132176 --arg devTools '[]' \
133177 --arg benchmarkTools '[]' \
134178 --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"
179+ 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"
136180 '
137181
138182 - name : Re-build Node.js on the merge commit
0 commit comments