Repository navigation
269 lines (232 loc) · 9.36 KB
/
Copy pathtest.yml
File metadata and controls
269 lines (232 loc) · 9.36 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: test
on:
workflow_dispatch:
# `develop` is the integration branch, so it has to be here for two reasons. It is the
# branch releases are cut from, and — less obviously — GitHub scopes the Actions cache
# to a branch and its base. A pull request can only restore a cache written by its base
# branch, so a workflow that never runs on `develop` writes no cache a pull request can
# read, and every run starts cold.
push:
branches: [develop, main]
pull_request:
concurrency:
# Keep every run on the long-lived branches so cancelled checks do not pollute their
# commit history. PRs and other branches share a group and cancel stale runs.
group: >-
${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')
&& format('{0}-{1}', github.workflow, github.run_id)
|| format('{0}-{1}', github.workflow, github.event.pull_request.number || github.ref) }}
cancel-in-progress: true
permissions:
contents: read
checks: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# The engine suite is sharded across JOBS rather than parallelised across workers inside
# one. The suite contains tests whose assertion is "this finished within N milliseconds",
# so their budget is really a statement about machine load: `bun test --parallel` passed on
# a 16-core idle host and failed in CI, where four workers sharing a runner's cores pushed
# a 3s wait past a 5s ceiling. A shard gets a runner to itself, so per-test wall clock stays
# what it was serially and only the total divides. See docs/TEST-PARALLELISM.md.
#
# `unit (linux)` is an aggregator that does no work. It exists so the required status check
# keeps a stable name while the jobs underneath it change shape — renaming a required check
# in the same pull request that introduces it is a deadlock, because the check the rule
# demands never reports.
jobs:
engine:
name: engine (linux ${{ matrix.shard }}/4)
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
# Every shard reports. Cancelling siblings on the first failure hides how much else
# is broken, which is the thing you want to know from a red run.
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
# The ripgrep tests resolve `rg` from PATH, then a cache dir, and only then download
# it from github.com. Relying on that download made tests hang to the harness timeout
# with nothing in the log naming the cause, so it is provisioned up front.
- name: Provision ripgrep
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq ripgrep
rg --version | head -1
- name: Configure git identity
run: |
git config --global user.email "bot@code.redrob.ai"
git config --global user.name "redrob"
- name: Run engine tests
run: ./scripts/test-shard.sh packages/redrob ${{ matrix.shard }} 4
env:
REDROB_EXPERIMENTAL_DISABLE_FILEWATCHER: "false"
core:
name: core (linux)
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Provision ripgrep
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq ripgrep
rg --version | head -1
- name: Configure git identity
run: |
git config --global user.email "bot@code.redrob.ai"
git config --global user.name "redrob"
# Not sharded: 933 tests in ~22s. Splitting it would cost more in runner setup than
# it saves.
- name: Run core tests
working-directory: packages/core
run: bun test --timeout 30000 --only-failures
- name: Check generated client
working-directory: packages/client
run: bun run check:generated
httpapi:
name: httpapi (linux)
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Provision ripgrep
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq ripgrep
rg --version | head -1
- name: Configure git identity
run: |
git config --global user.email "bot@code.redrob.ai"
git config --global user.name "redrob"
# Its own job rather than a step after the tests: ~1m38s that has no reason to sit
# behind anything else.
- name: Run HttpApi exerciser gates
working-directory: packages/redrob
run: bun run test:httpapi
unit:
name: unit (linux)
needs: [engine, core, httpapi]
# `always()` so a failing dependency still reports here rather than leaving the required
# check permanently "expected" — a skipped required check never resolves and blocks the
# pull request with no visible failure to fix.
if: always()
runs-on: ubuntu-latest
steps:
- name: Report
run: |
set -euo pipefail
printf 'engine %s\ncore %s\nhttpapi %s\n' \
"${{ needs.engine.result }}" "${{ needs.core.result }}" "${{ needs.httpapi.result }}"
# A matrix dependency reports one aggregated result, so a single red shard makes
# `needs.engine.result` a failure.
for result in "${{ needs.engine.result }}" "${{ needs.core.result }}" "${{ needs.httpapi.result }}"; do
if [ "$result" != "success" ]; then
echo "::error::a linux test job did not succeed"
exit 1
fi
done
echo "all linux test jobs succeeded"
windows:
name: unit (windows ${{ matrix.shard }}/4)
runs-on: windows-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
# Windows runs and reports, but does not block. Two path-normalization tests were failing
# here for a real reason — a drive-less rooted path resolved against the runner's D:
# workspace instead of the C: temp directory — and that is fixed; whether anything else is
# Windows-specific is not yet established, so this stays advisory until it has been green
# for a while.
#
# Sharded now, which the earlier diagnosis said not to do. That diagnosis was wrong: the
# job was not hanging after its tests. Turbo buffers each task's output until the task
# ends, so `core` flushing at 88s and `redrob` flushing 14 minutes later read as a stall.
# The engine suite genuinely takes 906s here against 381s on Linux, which is what nearly
# hit the 20-minute limit. Splitting it is the fix, and it is the same mechanism already
# proven on Linux.
continue-on-error: true
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Provision ripgrep
run: |
choco install ripgrep -y --no-progress
rg --version | head -1
- name: Configure git identity
run: |
git config --global user.email "bot@code.redrob.ai"
git config --global user.name "redrob"
- name: Run engine tests
run: ./scripts/test-shard.sh packages/redrob ${{ matrix.shard }} 4
env:
REDROB_EXPERIMENTAL_DISABLE_FILEWATCHER: "true"
windows-core:
name: unit (windows core)
runs-on: windows-latest
timeout-minutes: 25
continue-on-error: true
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "24"
- name: Setup Bun
uses: ./.github/actions/setup-bun
- name: Provision ripgrep
run: |
choco install ripgrep -y --no-progress
rg --version | head -1
- name: Configure git identity
run: |
git config --global user.email "bot@code.redrob.ai"
git config --global user.name "redrob"
- name: Run core tests
working-directory: packages/core
run: bun test --timeout 30000 --only-failures
env:
REDROB_EXPERIMENTAL_DISABLE_FILEWATCHER: "true"