-
Notifications
You must be signed in to change notification settings - Fork 17
212 lines (175 loc) · 6.13 KB
/
ci.yml
File metadata and controls
212 lines (175 loc) · 6.13 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
name: CI
on:
push:
branches: [master, main, develop]
paths-ignore:
- "**/*.md"
- "LICENSE"
- ".gitignore"
- "docs/**"
pull_request:
branches: [master, main]
paths-ignore:
- "**/*.md"
- "LICENSE"
- ".gitignore"
- "docs/**"
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_INCREMENTAL: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ==========================================================================
# Frontend: typecheck + test + build (uploads dist/ artifact)
# ==========================================================================
frontend:
name: Frontend
runs-on: blacksmith-32vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: Mount node_modules (sticky disk)
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-node-modules
path: ./node_modules
- name: Install dependencies
run: npm ci
- name: TypeScript type check
run: npm run typecheck
- name: Run tests
run: npm run test
- name: Build frontend
run: npm run build
- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: dist/
retention-days: 1
if-no-files-found: error
# ==========================================================================
# Rust: fmt + clippy + test (Ubuntu only, downloads dist/ artifact)
# ==========================================================================
rust-checks:
name: Rust Checks
runs-on: blacksmith-32vcpu-ubuntu-2404
needs: [frontend]
steps:
- uses: actions/checkout@v4
- name: Configure git auth for private dependencies
run: git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Mount apt cache (sticky disk)
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-apt-tauri-deps
path: /var/cache/apt/archives
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libglib2.0-dev libasound2-dev libxdo-dev mold
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: dist/
- name: Install Rust nightly (for fmt)
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Setup Rust cache
uses: useblacksmith/rust-cache@v3
with:
workspaces: src-tauri
- name: Check formatting
run: cargo +nightly fmt --all -- --check
working-directory: src-tauri
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
working-directory: src-tauri
- name: Run tests
run: cargo test
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
working-directory: src-tauri
# ==========================================================================
# GUI Check - macOS
# ==========================================================================
gui-check-macos:
name: GUI Check (macos)
runs-on: macos-latest-xlarge
needs: [frontend]
steps:
- uses: actions/checkout@v4
- name: Configure git auth for private dependencies
run: git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: dist/
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust cache
uses: useblacksmith/rust-cache@v3
with:
workspaces: src-tauri
- name: Check GUI build
run: cargo check
working-directory: src-tauri
# ==========================================================================
# GUI Check - Windows
# ==========================================================================
gui-check-windows:
name: GUI Check (windows)
runs-on: blacksmith-32vcpu-windows-2025
needs: [frontend]
steps:
- uses: actions/checkout@v4
- name: Configure git auth for private dependencies
run: git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: dist/
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust cache
uses: useblacksmith/rust-cache@v3
with:
workspaces: src-tauri
- name: Check GUI build
run: cargo check
working-directory: src-tauri
# ==========================================================================
# Final status check
# ==========================================================================
ci-success:
name: CI Success
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: [frontend, rust-checks, gui-check-macos, gui-check-windows]
if: always()
steps:
- name: Check all jobs
run: |
if [[ "${{ needs.frontend.result }}" == "failure" || \
"${{ needs.rust-checks.result }}" == "failure" || \
"${{ needs.gui-check-macos.result }}" == "failure" || \
"${{ needs.gui-check-windows.result }}" == "failure" ]]; then
echo "One or more jobs failed"
exit 1
fi
echo "All CI checks passed!"