-
-
Notifications
You must be signed in to change notification settings - Fork 34.9k
202 lines (189 loc) · 6.24 KB
/
test-shared.yml
File metadata and controls
202 lines (189 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# This action uses the following secrets:
# CACHIX_AUTH_TOKEN: Write access to nodejs.cachix.org – without it, the cache is read-only.
name: Test Shared libraries
on:
pull_request:
paths-ignore:
- '**.md'
- eslint.config.mjs
- '**/eslint.config_partial.mjs'
- android-configure
- android-configure.py
- android-patches/**
- benchmarks/**
- codecov.yml
- deps/ada/**
- deps/brotli/**
- deps/cares/**
- deps/crates/**
- deps/corepack/**
- deps/googletest/**
- deps/histogram/**
- deps/icu-small/**
- deps/icu-tmp/**
- deps/llhttp/**
- deps/merve/**
- deps/nbytes/**
- deps/nghttp2/**
- deps/ngtcp2/**
- deps/openssl/*/**
- deps/simdjson/**
- deps/sqlite/**
- deps/uv/**
- deps/uvwasi/**
- deps/zlib/**
- deps/zstd/**
- doc/**
- pyproject.yml
- tsconfig.json
- test/internet/**
- tools/**
- '!tools/gyp/**'
- '!tools/nix/**'
- '!tools/v8/**'
- '!tools/v8_gypfiles/**'
- typings/**
- vcbuild.bat
- .**
- '!.github/workflows/test-shared.yml'
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
- canary
- v[0-9]+.x-staging
- v[0-9]+.x
paths-ignore:
- '**.md'
- eslint.config.mjs
- '**/eslint.config_partial.mjs'
- android-configure
- android-configure.py
- android-patches/**
- benchmarks/**
- codecov.yml
- deps/ada/**
- deps/brotli/**
- deps/cares/**
- deps/crates/**
- deps/corepack/**
- deps/googletest/**
- deps/histogram/**
- deps/icu-small/**
- deps/icu-tmp/**
- deps/llhttp/**
- deps/merve/**
- deps/nbytes/**
- deps/nghttp2/**
- deps/ngtcp2/**
- deps/openssl/*/**
- deps/simdjson/**
- deps/sqlite/**
- deps/uv/**
- deps/uvwasi/**
- deps/zlib/**
- deps/zstd/**
- doc/**
- pyproject.yml
- tsconfig.json
- test/internet/**
- tools/**
- '!tools/gyp/**'
- '!tools/nix/**'
- '!tools/v8/**'
- '!tools/v8_gypfiles/**'
- typings/**
- vcbuild.bat
- .**
- '!.github/workflows/test-shared.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
FLAKY_TESTS: keep_retrying
permissions:
contents: read
jobs:
build-tarball:
if: github.event.pull_request.draft == false
name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }}
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
persist-credentials: false
- name: Make tarball
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
export DATESTRING=$(date "+%Y-%m-%d")
export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA")
./configure && make tar -j4 SKIP_XZ=1 SKIP_SHARED_DEPS=1
env:
DISTTYPE: nightly
- name: Upload tarball artifact
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: tarballs
path: '*.tar.gz'
compression-level: 0
build:
needs: build-tarball
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
system: x86_64-linux
- runner: ubuntu-24.04-arm
system: aarch64-linux
- runner: macos-15-intel
system: x86_64-darwin
- runner: macos-latest
system: aarch64-darwin
name: '${{ matrix.system }}: with shared libraries'
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
name: tarballs
path: tarballs
- name: Extract tarball
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
tar xzf tarballs/*.tar.gz -C "$RUNNER_TEMP"
echo "TAR_DIR=$RUNNER_TEMP/$(basename tarballs/*.tar.gz .tar.gz)" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
with:
extra_nix_config: sandbox = true
- uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: nodejs
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure sccache
if: github.base_ref == 'main' || github.ref_name == 'main'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
core.exportVariable('SCCACHE_GHA_ENABLED', 'on');
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('NIX_SCCACHE', '(import <nixpkgs> {}).sccache');
- name: Build Node.js and run tests
run: |
nix-shell \
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
--pure --keep TAR_DIR --keep FLAKY_TESTS \
--keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
--arg loadJSBuiltinsDynamically false \
--arg useSeparateDerivationForV8 true \
--arg ccache "${NIX_SCCACHE:-null}" \
--arg devTools '[]' \
--arg benchmarkTools '[]' \
${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }}
--run '
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
' "$TAR_DIR/shell.nix"