-
Notifications
You must be signed in to change notification settings - Fork 285
90 lines (77 loc) · 2.22 KB
/
ci.yml
File metadata and controls
90 lines (77 loc) · 2.22 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
# ClawPanel 持续集成工作流
# 在推送到 main 分支或提交 PR 到 main 分支时自动运行
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# 同一分支的新提交会取消正在运行的旧工作流
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: 检查 (${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
# macOS Apple Silicon
- name: macOS (ARM64)
os: macos-latest
# Linux x86_64
- name: Linux (x64)
os: ubuntu-latest
# Windows x86_64
- name: Windows (x64)
os: windows-latest
steps:
# 签出代码
- name: 签出代码
uses: actions/checkout@v4
# 安装 Node.js 22
- name: 安装 Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
# 安装前端依赖
- name: 安装前端依赖
run: npm ci
# 安装 Rust 工具链 (stable)
- name: 安装 Rust 工具链
uses: dtolnay/rust-toolchain@stable
# Rust 编译缓存
- name: Rust 编译缓存
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
# Linux 专用: 安装 Tauri v2 系统依赖
- name: 安装 Linux 系统依赖
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev
# Rust 格式检查
- name: Rust 格式检查
working-directory: src-tauri
run: cargo fmt --all -- --check
# Rust 编译检查
- name: Rust 编译检查
working-directory: src-tauri
run: cargo check
# Rust Lint(警告视为错误)
- name: Rust Clippy
working-directory: src-tauri
run: cargo clippy --all-targets -- -D warnings
# 前端构建验证
- name: 前端构建验证
run: npm run build