-
Notifications
You must be signed in to change notification settings - Fork 8
329 lines (269 loc) · 10 KB
/
Copy pathci.yml
File metadata and controls
329 lines (269 loc) · 10 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
322
323
324
325
326
327
328
329
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rustfmt
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: rustfmt
- name: Check Rust formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: clippy
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
target: target
- name: Run Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
typecheck:
name: TypeScript check
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Check TypeScript
run: vp run check:ts
test:
name: Test
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
target: target
- name: Check browser availability
run: google-chrome --version
- name: Run tests
run: vp run test
vscode-test:
name: VS Code extension tests
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
target: target
- name: Build ox-content-lsp (release)
run: vp run build:lsp
- name: Build VS Code extension
run: vp run vscode:build
- name: Run VS Code unit tests
run: vp run test:vscode-unit
- name: Run VS Code integration tests (xvfb)
# `vscode-test` launches a real Electron process, which needs an
# X server on Linux. xvfb-run -a allocates one on the fly.
run: xvfb-run -a node scripts/run-vscode-tests.mjs
zed-extension:
name: Zed extension build
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: wasm32-unknown-unknown
- name: Build Zed extension WASM
run: cargo build --manifest-path editors/zed/Cargo.toml --target wasm32-unknown-unknown
dependency-policy:
name: Dependency policy
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
- name: Install Cargo audit tools
run: cargo install cargo-audit cargo-deny --locked
- name: Check Cargo advisories
run: cargo audit --deny warnings
- name: Check Cargo licenses
run: cargo deny check licenses
- name: Check npm advisories
run: node scripts/check-npm-advisories.mjs
- name: Check npm licenses
run: node scripts/check-npm-licenses.mjs
package-dry-run:
name: Package dry-run
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
target: target
- name: Build publishable packages
run: vp run build:npm
- name: Ensure generated NAPI declarations are fresh
run: git diff --exit-code -- crates/ox_content_napi/index.d.ts
- name: Pack and inspect publishable packages
run: node scripts/package-dry-run.mjs
napi-smoke:
name: NAPI smoke - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- blacksmith-32vcpu-ubuntu-2404
- macos-latest
- windows-2025
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
if: startsWith(matrix.os, 'blacksmith-')
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}-${{ matrix.os }}
cargo: "true"
target: target
- name: Cache cargo
if: runner.os != 'Windows' && !startsWith(matrix.os, 'blacksmith-')
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
# Debug build: the smoke test only verifies the binding loads and that
# parseAndRender produces correct output — it does not benchmark. A debug
# build validates the same ABI/load/correctness path far faster than the
# release profile (fat LTO + codegen-units=1). Release artifacts are built
# and verified separately in publish.yml.
- name: Build local NAPI binding
working-directory: crates/ox_content_napi
run: vp exec -- napi build
- name: Load and parse smoke test
shell: bash
run: |
node - <<'NODE'
const napi = require("./crates/ox_content_napi");
const result = napi.parseAndRender("# Hello\n\nSmoke test", { gfm: true });
if (result.errors.length > 0) {
throw new Error(result.errors.join("\n"));
}
if (!result.html.includes("Hello</h1>")) {
throw new Error(`Unexpected render output: ${result.html}`);
}
console.log(`@ox-content/napi ${napi.version()} loaded on ${process.platform}-${process.arch}`);
NODE
build:
name: Build
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
with:
node-version-file: ".node-version"
cache: true
run-install: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Mount sticky cache
uses: ./.github/actions/mount-sticky-cache
with:
key-prefix: ${{ github.repository }}-ci-${{ github.job }}
cargo: "true"
target: target
browsers: "true"
- name: Install browsers for docs rendering
run: |
vp exec --filter @ox-content/vite-plugin -- playwright install --with-deps chromium
vp exec --filter @ox-content/vite-plugin -- puppeteer browsers install chrome-headless-shell
- name: Build
run: vp build