-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (150 loc) · 6.04 KB
/
Copy pathtest.yml
File metadata and controls
182 lines (150 loc) · 6.04 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
name: Test
# Runs on every push/PR. This is deliberately the *fast* workflow: type
# checking, linting, `cargo check`/`clippy`, and unit tests only — no full
# release builds and no packaging. See build.yml for the exhaustive
# per-target build/package matrix, which is much slower and only makes
# sense to run less aggressively (see its own triggers).
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Keep CI reasonably fast/cheap; bump if a job needs more.
CARGO_INCREMENTAL: 0
jobs:
frontend:
name: Frontend — typecheck & lint (Svelte/TS)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: npm ci
run: npm ci
- name: svelte-check (typecheck)
run: npm run lint
- name: vite build (frontend only, no Tauri binary)
run: npm run build -- --mode production
env:
# vite build without the Tauri backend doesn't need real
# secrets/config; this just verifies the bundle compiles.
VITE_CI: '1'
compositor-check:
name: Compositor — cargo check + clippy + test (if present)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# The Wayland compositor described in README.md hasn't landed in
# this tree yet — same "probe, don't assume" pattern as
# `blue-lock-check` below, so this workflow neither fails nor
# silently skips depending on repo state; it explicitly reports
# which it did.
- name: Check whether compositor/ exists yet
id: probe
run: |
if [ -f "compositor/Cargo.toml" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "::notice::compositor/Cargo.toml not found — skipping compositor checks (nothing to check yet)."
fi
- name: Install system dependencies
if: steps.probe.outputs.present == 'true'
run: |
sudo apt-get update
sudo apt-get install -y \
libwayland-dev libxkbcommon-dev libudev-dev libinput-dev \
libgbm-dev libdrm-dev libseat-dev libegl1-mesa-dev \
libgles2-mesa-dev pkg-config
- name: Install Rust toolchain
if: steps.probe.outputs.present == 'true'
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
if: steps.probe.outputs.present == 'true'
with:
workspaces: compositor -> target
- name: cargo fmt --check
if: steps.probe.outputs.present == 'true'
run: cargo fmt --manifest-path compositor/Cargo.toml -- --check
continue-on-error: true # style-only, shouldn't block CI on its own
- name: cargo check
if: steps.probe.outputs.present == 'true'
run: cargo check --manifest-path compositor/Cargo.toml --all-targets
- name: cargo clippy
if: steps.probe.outputs.present == 'true'
run: cargo clippy --manifest-path compositor/Cargo.toml --all-targets -- -D warnings
continue-on-error: true # tighten to blocking once the existing warning backlog is cleared
- name: cargo test
if: steps.probe.outputs.present == 'true'
run: cargo test --manifest-path compositor/Cargo.toml
shell-backend-check:
name: Shell backend (src-tauri) — cargo check + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies (Tauri v2 Linux build deps)
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \
librsvg2-dev libssl-dev pkg-config libudev-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# src-tauri is a member of the root Cargo.toml's workspace —
# actual build output lands in the workspace root's ./target,
# not ./src-tauri/target (unlike compositor above, which is a
# genuinely separate, standalone crate).
workspaces: . -> target
- name: cargo check
run: cargo check --manifest-path src-tauri/Cargo.toml --all-targets
- name: cargo test
run: cargo test --manifest-path src-tauri/Cargo.toml
auth-check:
name: auth (pattern-lock crate) — cargo check + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Same workspace as shell-backend-check above (auth is also a
# root-workspace member) — this job builds `auth` on its own,
# but it's still the same shared `./target` at the repo root.
workspaces: . -> target
- name: cargo check
run: cargo check --manifest-path auth/Cargo.toml --all-targets
- name: cargo test
run: cargo test --manifest-path auth/Cargo.toml
blue-lock-check:
name: blue-lock — cargo check (if present)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check whether blue-lock exists yet
id: probe
run: |
if [ -f "blue-lock/Cargo.toml" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
fi
- name: Install system dependencies
if: steps.probe.outputs.present == 'true'
run: |
sudo apt-get update
sudo apt-get install -y libwayland-dev libxkbcommon-dev libpam0g-dev
- name: Install Rust toolchain
if: steps.probe.outputs.present == 'true'
uses: dtolnay/rust-toolchain@stable
- name: cargo check
if: steps.probe.outputs.present == 'true'
run: cargo check --manifest-path blue-lock/Cargo.toml --all-targets