Repository navigation
454 lines (386 loc) · 15.5 KB
/
Copy pathci.yml
File metadata and controls
454 lines (386 loc) · 15.5 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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
name: "CI"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
desktop: ${{ steps.filter.outputs.desktop }}
rust: ${{ steps.filter.outputs.rust }}
tauri-plugins: ${{ steps.filter.outputs.tauri-plugins }}
branch: ${{ steps.branch.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
desktop:
- '.gitattributes'
- '.github/actions/install-desktop-deps/**'
- '.github/actions/setup-js/**'
- '.github/workflows/ci.yml'
- 'apps/cli/**'
- 'apps/desktop/**'
- 'apps/desktop-gpui/**'
- 'crates/**'
- 'packages/database/**'
- 'packages/ui-solid/**'
- 'packages/utils/**'
- 'packages/web-api-contract/**'
- 'scripts/build-desktop-binaries*'
- 'scripts/build-gpui-binary.sh'
- 'scripts/build-linux-packages.mjs'
- 'scripts/build-macos-packages*'
- 'scripts/bundle-gpui*'
- 'scripts/finalize-linux-*'
- 'scripts/finalize-macos-*'
- 'scripts/linux-bundle-config*'
- 'scripts/prepare-gpui-dependency*'
- 'scripts/run-gpui-build*'
- 'scripts/sync-desktop-versions.mjs'
- 'scripts/verify-gpui-release-inputs.mjs'
- 'Cargo.toml'
- 'Cargo.lock'
- 'bun.lock'
- 'bunfig.toml'
- 'package.json'
rust:
- '.cargo/**'
- '.github/**'
- 'apps/cli/**'
- 'apps/desktop-gpui/**'
- 'crates/**'
- 'apps/desktop/src-tauri/**'
- 'Cargo.toml'
- 'Cargo.lock'
tauri-plugins:
- 'Cargo.lock'
- 'bun.lock'
- 'scripts/check-tauri-plugin-versions*'
- 'apps/desktop/package.json'
- name: Output branch name
id: branch
run: |
echo "branch=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- run: bun run --cwd apps/web next typegen
- name: Check MCP card bundle
run: bun run --cwd apps/web mcp-card:check
- name: Test workspace tooling
run: node --test scripts/bun-scripts.test.mjs scripts/check-tauri-plugin-versions.test.mjs
- name: Test Loops profile sync
run: |
bun test scripts/loops/profile.test.ts scripts/loops/lifecycle.test.ts
bun run tsc --noEmit --strict --jsx react-jsx --allowImportingTsExtensions --target ESNext --module ESNext --moduleResolution bundler --resolveJsonModule --types bun --skipLibCheck scripts/loops/*.ts
- name: Test render farm orchestration
run: |
bun test apps/render-farm
bun run --cwd apps/render-farm typecheck
- name: Test web React compatibility
run: >-
bun run --cwd apps/web test
__tests__/unit/embed-video-playback-chrome.test.ts
__tests__/unit/homepage-demo-accessibility.test.ts
__tests__/unit/linkified-text.test.ts
__tests__/unit/loom-import-ui.test.ts
__tests__/unit/media-player-store-refs.test.ts
__tests__/unit/seo-demo-videos.test.ts
__tests__/unit/signed-baa-card.test.ts
__tests__/unit/summary-editor.test.ts
__tests__/unit/sso-login-pages.test.ts
- name: Typecheck
run: bun run typecheck
mobile:
name: Mobile
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- name: Check Expo dependencies
env:
EXPO_OFFLINE: "1"
run: bun run --cwd apps/mobile expo install --check
- name: Run Expo Doctor
env:
EXPO_OFFLINE: "1"
working-directory: apps/mobile
run: bunx expo-doctor@1.20.1
- name: Typecheck
run: bun run --cwd apps/mobile typecheck
- name: Test
run: bun run --cwd apps/mobile test
format-biome:
name: Format (Biome)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
# Don't use `latest` as Biome throws an error when it doesn't match the
# schema version in the config file.
version: 2.2.0
- name: Run Biome
run: biome ci . --linter-enabled=false
format-rust:
name: Format (Cargo)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check
clippy:
name: Clippy
needs: changes
if: needs.changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
runner: macos-latest
- target: x86_64-pc-windows-msvc
runner: windows-2022
runs-on: ${{ matrix.settings.runner }}
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@1.88.0
with:
targets: ${{ matrix.settings.target }}
components: clippy
- uses: ./.github/actions/setup-rust-cache
with:
target: ${{ matrix.settings.target }}
- name: Create .env file in root
run: |
echo "VITE_ENVIRONMENT=production" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env
echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env
echo 'NEXTAUTH_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo 'VITE_OPENPANEL_CLIENT_ID=${{ secrets.VITE_OPENPANEL_CLIENT_ID }}' >> .env
echo 'VITE_OPENPANEL_API_URL=${{ secrets.VITE_OPENPANEL_API_URL }}' >> .env
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
cat .env >> $GITHUB_ENV
- name: Run setup
shell: bash
run: node scripts/setup.js
- name: Test desktop installation and storage helpers
shell: bash
run: cargo test --locked -p cap-utils -p cap-cli-install --lib
- name: Build desktop binaries
shell: bash
run: ./scripts/build-desktop-binaries.sh ${{ matrix.settings.target }}
- name: Run Clippy
run: cargo clippy --workspace --all-features --locked -- -D warnings
lint-biome:
name: Lint (Biome)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci . || true
build-desktop:
name: Build Desktop
needs: changes
if: needs.changes.outputs.desktop == 'true'
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
runner: macos-latest
- target: x86_64-pc-windows-msvc
runner: windows-2022
- target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
runs-on: ${{ matrix.settings.runner }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test desktop build preparation
run: node --test scripts/prepare-gpui-dependency.test.mjs scripts/build-macos-packages.test.mjs scripts/bundle-gpui.test.mjs scripts/finalize-macos-packages.test.mjs
- name: Install Linux desktop dependencies
if: ${{ runner.os == 'Linux' }}
uses: ./.github/actions/install-desktop-deps
- name: Rust setup
uses: dtolnay/rust-toolchain@1.88.0
with:
targets: ${{ matrix.settings.target }}
- uses: ./.github/actions/setup-rust-cache
with:
target: ${{ matrix.settings.target }}
- uses: ./.github/actions/setup-js
- name: Create .env file in root
run: |
echo "VITE_ENVIRONMENT=production" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env
echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env
echo 'NEXTAUTH_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo 'VITE_OPENPANEL_CLIENT_ID=${{ secrets.VITE_OPENPANEL_CLIENT_ID }}' >> .env
echo 'VITE_OPENPANEL_API_URL=${{ secrets.VITE_OPENPANEL_API_URL }}' >> .env
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
- name: Output .env file
run: cat apps/desktop/.env
- name: Run cap-setup
shell: bash
run: bun run cap-setup
env:
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
- name: Build desktop binaries
shell: bash
run: ./scripts/build-desktop-binaries.sh ${{ matrix.settings.target }}
- name: Test Windows startup logging regressions
if: runner.os == 'Windows'
shell: bash
run: |
export PATH="$(cygpath "$GITHUB_WORKSPACE/target/debug"):$PATH"
cargo test --locked -p cap-desktop --target ${{ matrix.settings.target }} --bin cap-desktop logging_tests
cargo test --locked -p cap-desktop --target ${{ matrix.settings.target }} --test crash_sentinel
- name: Test Linux desktop regressions
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
node --test scripts/linux-bundle-config.test.mjs scripts/finalize-linux-appimage.test.mjs scripts/finalize-linux-gpui-packages.test.mjs
bun run --cwd apps/desktop vitest run scripts/prepare.test.js
cargo test --locked -p cap-utils -p cap-cli-install --lib
cargo test --locked -p cap --bin cap record::tests
cargo test --locked -p cap-recording --lib -- --test-threads=1
cargo test --locked -p cap-enc-ffmpeg
cargo test --locked -p cap-desktop --lib render_frame_event
env:
LD_LIBRARY_PATH: ${{ format('{0}/target/native-deps/lib:{0}/target/debug:{0}/target/{1}/debug', github.workspace, matrix.settings.target) }}
- name: Test export estimate request lifecycle
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$(cygpath "$GITHUB_WORKSPACE/target/debug"):$PATH"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
export LD_LIBRARY_PATH="$GITHUB_WORKSPACE/target/native-deps/lib:$GITHUB_WORKSPACE/target/debug:$GITHUB_WORKSPACE/target/${{ matrix.settings.target }}/debug${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
cargo test --locked -p cap-desktop --test export_estimate_request
- name: Build GPUI desktop
shell: bash
run: ./scripts/build-gpui-binary.sh debug ${{ matrix.settings.target }}
- name: Test export preview device-loss handling
shell: bash
run: cargo test --locked -p cap-desktop --test gpu_device_health
- name: Test GPUI desktop
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$(cygpath "$GITHUB_WORKSPACE/target/debug"):$PATH"
elif [[ "$RUNNER_OS" == "macOS" ]]; then
frameworks="$GITHUB_WORKSPACE/apps/desktop-gpui/target/${{ matrix.settings.target }}/debug/Frameworks"
mkdir -p "$frameworks"
ln -sfn "$GITHUB_WORKSPACE/target/Frameworks/Spacedrive.framework" "$frameworks/Spacedrive.framework"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
export LD_LIBRARY_PATH="$GITHUB_WORKSPACE/target/native-deps/lib:$GITHUB_WORKSPACE/target/debug:$GITHUB_WORKSPACE/target/${{ matrix.settings.target }}/debug${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
xvfb-run -a --server-args="-screen 0 1920x1080x24 -noreset" \
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} --bin cap-gpui
else
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} --bin cap-gpui
fi
cargo +1.95.0 test --manifest-path apps/desktop-gpui/Cargo.toml --locked --target ${{ matrix.settings.target }} -p cap-gpui-kernels
- name: Build app
working-directory: apps/desktop
run: bun run tauri build --debug --target ${{ matrix.settings.target }} --no-bundle
env:
LD_LIBRARY_PATH: ${{ runner.os == 'Linux' && format('{0}/target/native-deps/lib:{0}/target/debug:{0}/target/{1}/debug', github.workspace, matrix.settings.target) || '' }}
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
tauri-plugins:
name: Verify Tauri plugin versions
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.tauri-plugins == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- name: Run verify
shell: bash
run: node scripts/check-tauri-plugin-versions.js
rust-cache:
name: Rust cache
needs: changes
if: needs.changes.outputs.branch == 'main'
strategy:
fail-fast: false
matrix:
settings:
- target: x86_64-apple-darwin
runner: macos-latest
- target: aarch64-apple-darwin
runner: macos-latest
- target: x86_64-pc-windows-msvc
runner: windows-2022
runs-on: ${{ matrix.settings.runner }}
env:
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@1.88.0
with:
targets: ${{ matrix.settings.target }}
components: clippy
- uses: ./.github/actions/setup-rust-cache
with:
target: ${{ matrix.settings.target }}
save-cache: true
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 24
- run: node scripts/setup.js
- name: Build desktop binaries
shell: bash
run: ./scripts/build-desktop-binaries.sh ${{ matrix.settings.target }}
- name: Build debug
run: cargo build --all --target ${{ matrix.settings.target }}
- name: Build release
run: cargo check --all --release --target ${{ matrix.settings.target }}
- name: Run Clippy
if: ${{ matrix.settings.target == 'aarch64-apple-darwin' || matrix.settings.target == 'x86_64-pc-windows-msvc' }}
run: cargo clippy --workspace --all-features --locked --target ${{ matrix.settings.target }} -- -D warnings