Repository navigation
320 lines (308 loc) · 12.9 KB
/
Copy pathci.yml
File metadata and controls
320 lines (308 loc) · 12.9 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
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "*"
# `shell-<tag>` only records which commit a release's gpui-shell
# binaries were built from; that commit has been tested already.
- "!shell-*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
cancel-in-progress: true
env:
# Debug info is most of a build's disk footprint and a large share of its
# link time, and nothing in CI reads it. Dropping it keeps every job's
# dependency cache small enough to stay under the repository's 10 GB cache
# limit instead of being evicted before the next run can use it.
CARGO_PROFILE_DEV_DEBUG: 0
# Every job that compiles Rust relies on the dependency cache that
# `actions-rust-lang/setup-rust-toolchain` installs (Swatinem/rust-cache).
# Only `main` saves caches; pull requests restore the closest `main` cache
# through rust-cache's prefix fallback, so PR runs never crowd `main`'s
# caches out of the 10 GB limit. Keep each job on one feature set: a second
# `cargo` invocation with different features recompiles GPUI from scratch,
# which is what made the old single macOS job take half an hour.
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Typo check
uses: crate-ci/typos@v1.40.0
- name: Verify published recipe fragments
run: python3 script/check-ai docs
- uses: oven-sh/setup-bun@v2
- name: gpui-pre is pinned exactly
run: bun script/check-gpui-pin.ts
- uses: taiki-e/install-action@v2
with:
tool: cargo-machete@0.9.1
- name: Machete
run: cargo machete
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
# Lints every member and, as a side effect, type-checks the example
# crates that the `test` job leaves out. The WebView example enables
# `gpui-kit/gpui-fast`, which feature unification would spread to every
# member, so it is linted on its own.
- name: Lint
run: cargo clippy --workspace --exclude gpui-shell --exclude webview --locked -- --deny warnings
- name: Lint WebView (GPUI Fast)
run: cargo clippy -p gpui-webview -p webview --features gpui-kit/gpui-fast,gpui-webview/gpui-fast --locked -- --deny warnings
no-default-features:
name: No default features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
- name: Check without default features (tree-sitter disabled)
run: cargo check -p gpui-component --no-default-features --locked
# Control callback, legacy alias, and Form contract tests on the same
# feature set, so they reuse the build above.
- name: Test without default features
run: python3 script/check-ai rust
test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
run_on: macos-latest
- target: x86_64-linux-gnu
run_on: ubuntu-latest
- target: x86_64-windows-msvc
run_on: windows-latest
runs-on: ${{ matrix.run_on }}
defaults:
run:
# `$TEST_EXCLUDES` must word-split, which PowerShell does not do.
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
# Compiling and linking a test binary for every `examples/` crate was
# most of the warm-cache build time; the `lint` job type-checks them
# instead. Leaving them out changes no crate's feature set. The recipes
# crate stays in: its tests are what certify the documentation's code.
# `gpui-webview`'s tests cover GPUI Fast composition, so the GPUI Fast
# job runs them; the `webview-gpui-pre` job lints the gpui-pre build.
# `jq -j` writes the list as one line with no newline at all: on Windows
# `jq` emits CRLF, and a `\r` left on a name breaks `--exclude`.
- name: Leave the example crates to the lint job
run: |
excludes=$(cargo metadata --no-deps --format-version 1 | jq -j '
((.workspace_root | gsub("\\\\"; "/")) + "/examples/") as $examples
| .packages[]
| select((((.manifest_path | gsub("\\\\"; "/")) | startswith($examples))
and .name != "gpui-kit-recipes") or .name == "gpui-webview")
| "--exclude \(.name) "')
echo "TEST_EXCLUDES=$excludes" >> "$GITHUB_ENV"
# `gpui-component-story/test-support` turns on `gpui-kit/test-support`, so
# this single run also covers the headless UI integration tests in
# `crates/kit/tests`.
- name: Test
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES
- name: Doc tests
if: ${{ matrix.run_on == 'macos-latest' }}
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES --doc
# `crates/kit/tests/rendering.rs` needs a real renderer and is opted
# out of the default test set; select it with the same feature set so it
# reuses the build above.
- name: Install Linux offscreen renderer
if: ${{ matrix.run_on == 'ubuntu-latest' }}
run: sudo apt-get install -y mesa-vulkan-drivers
- name: UI rendering tests
if: ${{ matrix.run_on != 'windows-latest' }}
run: >-
cargo test --workspace --exclude gpui-shell
--features gpui-component-story/test-support --locked
$TEST_EXCLUDES --test rendering
gpui-fast:
name: GPUI Fast (${{ matrix.run_on }})
strategy:
fail-fast: false
matrix:
run_on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.run_on }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-fast
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Test GPUI Fast facade and UI integration
run: cargo test -p gpui-kit --features gpui-fast,test-support --locked
- name: Test Component tooltip lifecycle with GPUI Fast
run: >-
cargo test -p gpui-component --features gpui-fast,test-support
--lib tooltip::tests:: --locked
- name: Test WebView
run: cargo test -p gpui-webview --features gpui-fast,gpui-kit/gpui-fast --locked
# `gpui-webview` defaults to gpui-pre, where the native view is attached to
# the window directly; this keeps that build compiling on every platform.
webview-gpui-pre:
name: WebView on gpui-pre (${{ matrix.run_on }})
strategy:
fail-fast: false
matrix:
run_on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.run_on }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Lint WebView on gpui-pre
run: cargo clippy -p gpui-webview --all-targets --locked -- --deny warnings
gpui-fast-web:
name: GPUI Fast (WebAssembly)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-fast-web
- name: Install system dependencies
run: script/bootstrap
- name: Check GPUI Fast WebAssembly
run: cargo check -p gpui-kit --features gpui-fast --target wasm32-unknown-unknown --locked
gpui-shell-core:
name: GPUI Shell Core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-shell-release
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
- name: Test runtime core without standard-library integration cases
run: |
cargo test -p gpui-shell --release --lib -- \
--skip tests::standard_runtime \
--skip tests::network \
--skip tests::fs \
--skip tests::process \
--skip tests::benchmark
cargo test -p gpui-shell --release tests::benchmark
cargo test -p gpui-shell --release --doc
- name: Lint GPUI Shell
run: cargo clippy -p gpui-shell --all-targets -- -D warnings
# The `components` feature is the only edge to `gpui-component`; the
# runtime must still build without it.
- name: Check GPUI Shell without the component catalog
run: cargo check -p gpui-shell --no-default-features --features quickjs
gpui-shell-components:
name: GPUI Shell Components
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: actions/setup-node@v4
with:
node-version: 22
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
run: script/bootstrap
# The catalog's unit tests run with the library in `gpui-shell-core`;
# these are its host integration tests and the command-line tests.
- name: Test component bindings
run: cargo test -p gpui-shell --tests
- name: Verify generated TypeScript contracts
run: |
npm --prefix crates/shell/tests/types ci
npm --prefix crates/shell/tests/types test
# The inventory test proves every public component is registered or
# explicitly deferred; this proves the JavaScript gallery covers what the
# inventory claims. Without it the two drift silently.
- name: Verify story coverage against the component inventory
run: node examples/js_story/fixtures/verify-coverage.mjs
gpui-shell-standard-runtime:
name: GPUI Shell Standard Runtime (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
run_on: macos-latest
- target: x86_64-linux-gnu
run_on: ubuntu-latest
- target: x86_64-windows-msvc
run_on: windows-latest
runs-on: ${{ matrix.run_on }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
cache-shared-key: gpui-shell-release
# Replaces the system `ld` on Linux and is a no-op elsewhere.
- uses: rui314/setup-mold@v1
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Test LLRT module integration
run: |
cargo test -p gpui-shell --release tests::standard_runtime
cargo test -p gpui-shell --release tests::fs
cargo test -p gpui-shell --release tests::process
cargo test -p gpui-shell --release tests::network
cargo test -p gpui-shell --release tests::render
cargo test -p gpui-shell --release tests::snapshot
cargo test -p gpui-shell --release tests::host_api
cargo test -p gpui-shell --release tests::http_request