-
Notifications
You must be signed in to change notification settings - Fork 1
132 lines (109 loc) · 4.05 KB
/
Copy pathci.yml
File metadata and controls
132 lines (109 loc) · 4.05 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel an in-flight CI run when a new commit is pushed to the same branch /
# PR — saves CI minutes and keeps the head of the queue current.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Least-privilege: nothing in this workflow needs more than read access.
permissions:
contents: read
jobs:
rust:
name: Rust — fmt, clippy & tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: ${{ matrix.os }}
# Tauri pulls webkit at build time even for `cargo check` / `cargo test`,
# so we install the same Linux deps the release job uses.
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: cargo fmt --check
working-directory: src-tauri
run: cargo fmt --all -- --check
- name: cargo clippy (lib + tests, deny warnings)
working-directory: src-tauri
run: cargo clippy --lib --tests -- -D warnings
- name: cargo test --lib
working-directory: src-tauri
run: cargo test --lib
frontend:
name: Frontend — svelte-check & lint
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install frontend dependencies
run: npm ci
# `npm run check` runs `svelte-kit sync` first (generates routing types)
# and points svelte-check at the project's tsconfig. The trailing
# `-- --fail-on-warnings` matches the project gate per CLAUDE.md
# ("zero warnings on cargo clippy and svelte-check").
- name: svelte-check (via npm run check)
run: npm run check -- --fail-on-warnings
# Both prettier and eslint gate the build. The earlier eslint
# debt was cleared in the sweep that flipped this step from
# non-blocking to blocking — keep the bar there.
- name: Prettier — check formatting
run: npx prettier --check .
- name: ESLint
run: npx eslint .
build:
name: Build — full Tauri app (Linux, debug)
runs-on: ubuntu-22.04
timeout-minutes: 25
needs: [rust, frontend]
steps:
- uses: actions/checkout@v6
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: build-linux-debug
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Install frontend dependencies
run: npm ci
# End-to-end build verification: frontend → cargo → tauri-cli bundling.
# Catches platform-specific build breakage at PR time instead of at tag time.
# `--debug` skips heavy LTO/strip but exercises the full pipeline.
# `--bundles deb,appimage` matches the Linux targets we actually ship in
# release.yml. RPM bundling hangs indefinitely on the GitHub runner
# (rpmbuild network/entropy issue) and we don't ship .rpm, so skip it.
- name: tauri build --debug (deb + appimage only)
run: npm run tauri -- build --debug --bundles deb,appimage