-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (85 loc) · 2.65 KB
/
Copy pathtest.yml
File metadata and controls
91 lines (85 loc) · 2.65 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
name: Test
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
rust_test:
name: Tests for Rust backend
runs-on: windows-latest
strategy:
matrix:
toolchain:
- stable
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: "20.x"
- name: Build frontend
run: |
cd client
npm ci
npm run build
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --verbose
- run: cargo test --verbose
clippy_check:
name: Linting for Rust backend
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: "20.x"
- name: Build frontend
run: |
cd client
npm ci
npm run build
- uses: Swatinem/rust-cache@v2
- run: cargo clippy
permissions:
checks: write
rustfmt_check:
name: Formatting for Rust backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup update stable && rustup default stable && rustup component add rustfmt
# Source-only formatting check (no compile / no frontend build needed). Run `cargo fmt` to fix.
- run: cargo fmt --all --check
client_test:
name: Tests and linting for React client
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: "20.x"
- run: npm ci
- run: npm run check
- run: npm run build
# Coverage-gated (replaces plain test:unit): vite.config's ratchet thresholds fail this
# job on regression, so coverage can never silently drift again (it slid 99.4→97.7
# unnoticed because CI only ran the tests, never the thresholds).
- run: npm run test:coverage
- run: npm run lint
# Fail if docs/widgets.md drifted from the widget registry (run `npm run gen:docs` to refresh).
- run: npm run check:docs
# E2E (Playwright): drives the studio in a real browser via the dev Tauri mock. The config's
# webServer auto-starts `vite` (dev → devMock is active; it's stripped from prod builds), so no
# separate server step is needed. Browsers must be installed first.
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e