@@ -57,7 +57,57 @@ 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+ --run '
95+ ./configure && make tar -j8 SKIP_XZ=1 SKIP_SHARED_DEPS=1
96+ '
97+ env :
98+ DISTTYPE : nightly
99+
100+
101+ - name : Upload tarball artifact
102+ if : ${{ github.event_name != 'workflow_dispatch' }}
103+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
104+ with :
105+ name : tarballs
106+ path : ' *.tar.gz'
107+ compression-level : 0
108+
60109 build :
110+ needs : build-tarball
61111 strategy :
62112 fail-fast : false
63113 matrix :
@@ -73,10 +123,17 @@ jobs:
73123 name : ' ${{ matrix.system }}: with shared libraries'
74124 runs-on : ${{ matrix.runner }}
75125 steps :
76- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+ - uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
77127 if : ${{ github.event_name != 'workflow_dispatch' }}
78128 with :
79- persist-credentials : false
129+ name : tarballs
130+ path : tarballs
131+
132+ - name : Extract tarball
133+ if : ${{ github.event_name != 'workflow_dispatch' }}
134+ run : |
135+ tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
136+ echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
80137
81138 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82139 if : ${{ github.event_name == 'workflow_dispatch' }}
@@ -116,23 +173,22 @@ jobs:
116173
117174 - name : Patch npm gyp (to be able to build addons for the tests)
118175 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
176+ 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"
120177
121178 - name : Load shell.nix
122- if : ${{ github.event_name == 'workflow_dispatch' }}
123179 run : curl -fsLSO https://github.com/${GITHUB_REPOSITORY}/raw/${GITHUB_SHA}/shell.nix
124180
125181 - name : Build Node.js ${{ github.event_name == 'workflow_dispatch' && 'on the base commit' || 'and run tests' }}
126182 run : |
127183 nix-shell \
128- --pure --keep FLAKY_TESTS \
184+ --pure --keep TAR_DIR --keep FLAKY_TESTS \
129185 --keep SCCACHE_GHA_VERSION --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
130186 --arg loadJSBuiltinsDynamically false \
131187 --arg ccache '(import <nixpkgs> {}).sccache' \
132188 --arg devTools '[]' \
133189 --arg benchmarkTools '[]' \
134190 --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"
191+ 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"
136192 '
137193
138194 - name : Re-build Node.js on the merge commit
0 commit comments