-
Notifications
You must be signed in to change notification settings - Fork 0
321 lines (274 loc) · 9.44 KB
/
Copy pathci.yml
File metadata and controls
321 lines (274 loc) · 9.44 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
name: CI
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
inputs:
heavy_build:
description: "Optional fat VS Code build (manual only)"
type: choice
required: false
default: none
options:
- none
- reh
- web
- reh-and-e2e
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
monorepo:
name: Build & test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11.11.0
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- name: Guard against test-web in release paths
run: bash scripts/check-no-test-web-in-release.sh
e2e:
name: Playwright e2e
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11.11.0
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Build surfaces
run: |
pnpm --filter @zcode/cli build
pnpm --filter @zcode/web build
pnpm --filter zcode-browser-fs build
pnpm --filter zcode-git build
pnpm --filter @zcode/workbench build
- name: Stage vscode-web (dogfood)
run: bash scripts/fetch-vscode-web.sh
- name: Install Playwright Chromium
run: pnpm --filter @zcode/e2e install-browsers
- name: Run Playwright
run: pnpm --filter @zcode/e2e test
env:
CI: true
ZCODE_E2E_PORT: 15010
- name: Upload report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: e2e/playwright-report
if-no-files-found: ignore
vscode-patches:
name: VS Code patches (quilt)
runs-on: ubuntu-latest
timeout-minutes: 30
# Only when submodule is present in the commit
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Check submodule registration
id: sub
run: |
if [[ -f .gitmodules ]] && grep -q 'vendor/vscode' .gitmodules; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "No vendor/vscode submodule yet — skip"
fi
- name: Install quilt
if: steps.sub.outputs.present == 'true'
run: sudo apt-get update && sudo apt-get install -y quilt
- name: Sync vscode + apply patches
if: steps.sub.outputs.present == 'true'
run: |
git submodule update --init --depth 1 vendor/vscode
bash scripts/sync-vscode.sh
- name: build-server prerequisites
if: steps.sub.outputs.present == 'true'
run: bash scripts/build-server.sh --check
- name: build-web prerequisites
if: steps.sub.outputs.present == 'true'
run: bash scripts/build-web.sh --check
# Full REH / owned web compile is intentionally manual — multi-hour, large disk.
# Node 24 matches vendor/vscode/.nvmrc (pin 1.129).
# Trigger: Actions → CI → Run workflow → heavy_build = reh | web | reh-and-e2e
vscode-reh-build:
name: VS Code REH build (manual)
if: >
github.event_name == 'workflow_dispatch' &&
(github.event.inputs.heavy_build == 'reh' ||
github.event.inputs.heavy_build == 'reh-and-e2e')
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: Free disk
run: |
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift || true
# Drop large preinstalled toolchains used by GitHub runners
sudo docker system prune -af || true
df -h
- name: Build REH
env:
ZCODE_REH_PLATFORM: linux
ZCODE_REH_ARCH: x64
# Helps @vscode/ripgrep postinstall avoid anonymous GitHub 403s
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash scripts/build-server.sh
- name: Upload dist/server
uses: actions/upload-artifact@v4
with:
name: zcode-reh-linux-x64
path: dist/server
if-no-files-found: error
retention-days: 14
vscode-web-build:
name: Owned vscode-web build (manual)
if: >
github.event_name == 'workflow_dispatch' &&
github.event.inputs.heavy_build == 'web'
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: Free disk
run: |
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift || true
sudo docker system prune -af || true
df -h
- name: build-web check
run: bash scripts/build-web.sh --check
- name: Package owned vscode-web
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bash scripts/build-web.sh --package
- name: Verify owned marker
run: |
test -f dist/vscode-web/.zcode-vscode-web.json
grep -q '"source": "owned"' dist/vscode-web/.zcode-vscode-web.json
test -f dist/vscode-web/out/vs/loader.js
- name: Upload dist/vscode-web
uses: actions/upload-artifact@v4
with:
name: zcode-vscode-web
path: dist/vscode-web
if-no-files-found: error
retention-days: 14
# R6 after REH artifact exists — not on default PR path.
vscode-reh-e2e:
name: R6 REH terminal e2e (manual)
if: >
github.event_name == 'workflow_dispatch' &&
github.event.inputs.heavy_build == 'reh-and-e2e'
needs: [vscode-reh-build]
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11.11.0
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile
- name: Download REH artifact
uses: actions/download-artifact@v4
with:
name: zcode-reh-linux-x64
path: dist/server
# Artifact zips often drop +x; also flatten accidental nesting from upload path.
- name: Normalize dist/server layout
run: |
set -euo pipefail
# Flatten if artifact was nested (dist/server/dist/server or artifact name folder)
for nested in dist/server/dist/server "dist/server/zcode-reh-linux-x64"; do
if [[ -d "${nested}" ]] && [[ -f "${nested}/.zcode-build.json" || -d "${nested}/bin" ]]; then
echo "Flattening nested REH layout from ${nested}"
shopt -s dotglob
tmp="$(mktemp -d)"
mv "${nested}"/* "${tmp}/"
rm -rf dist/server
mkdir -p dist/server
mv "${tmp}"/* dist/server/
rmdir "${tmp}" 2>/dev/null || true
fi
done
if [[ -d dist/server/bin ]]; then
chmod +x dist/server/bin/* 2>/dev/null || true
find dist/server/bin -type f -exec chmod +x {} + 2>/dev/null || true
fi
[[ -f dist/server/node ]] && chmod +x dist/server/node || true
[[ -f dist/server/server.sh ]] && chmod +x dist/server/server.sh || true
test -f dist/server/.zcode-build.json
test -f dist/server/bin/code-server-oss \
-o -f dist/server/bin/code-server \
-o -f dist/server/server.sh
echo "REH marker:" && cat dist/server/.zcode-build.json
ls -la dist/server/bin 2>/dev/null | head -20
- name: Build surfaces
run: |
pnpm --filter @zcode/cli build
pnpm --filter @zcode/server build
pnpm --filter @zcode/web build
pnpm --filter zcode-browser-fs build
pnpm --filter zcode-git build
pnpm --filter @zcode/workbench build
bash scripts/fetch-vscode-web.sh
- name: Install Playwright Chromium
run: pnpm --filter @zcode/e2e install-browsers
- name: R6 e2e (required + STRICT + PTY hard-fail)
env:
CI: true
ZCODE_E2E_REH_REQUIRED: "1"
# Workbench remote contract + terminal echo (printf zcode_echo_ok)
ZCODE_E2E_REH_STRICT: "1"
# Fail the job if integrated terminal does not print zcode_echo_ok
ZCODE_E2E_REH_PTY_REQUIRED: "1"
ZCODE_E2E_PASSWORD: zcode-e2e
ZCODE_SPAWN_REH: "1"
run: bash scripts/e2e-reh-terminal.sh
- name: Upload report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-reh-report
path: e2e/playwright-report
if-no-files-found: ignore