-
Notifications
You must be signed in to change notification settings - Fork 115
77 lines (73 loc) · 2.07 KB
/
Copy pathci.yml
File metadata and controls
77 lines (73 loc) · 2.07 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
name: CI
# 开发期门禁:PR / push 即验证,不再等 tag 发版才暴露破坏。
on:
push:
branches: [main, master]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend:
name: 前端测试
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
- name: TypeScript 与 Svelte 检查
run: npm run check
- name: 全量前端测试
run: npm run test:frontend
- name: 生产构建
run: npm run build
backend:
name: Rust 检查与测试(${{ matrix.platform }})
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
- platform: ubuntu-22.04
- platform: windows-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@1.97.1
with:
components: rustfmt, clippy
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- name: Install Linux build dependencies
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Rust 缓存
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
- name: Install frontend dependencies
run: npm ci
- name: Build frontend assets for Rust tests
run: npm run build
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo check(0 warning 基线)
run: cargo check --workspace --all-targets
env:
RUSTFLAGS: -D warnings
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace --all-targets