-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.34 KB
/
Copy pathci.yml
File metadata and controls
84 lines (70 loc) · 2.34 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
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
jobs:
check:
name: ${{ matrix.platform.label }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { os: ubuntu-latest, label: ubuntu }
- { os: macos-latest, label: macos }
- { os: windows-latest, label: windows }
steps:
- uses: actions/checkout@v4
# ──────────────── system deps ────────────────
- name: Install Linux system deps
if: matrix.platform.label == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libsoup-3.0-dev \
libjavascriptcoregtk-4.1-dev \
libxdo-dev \
libasound2-dev \
libssl-dev \
pkg-config
# ──────────────── toolchains ────────────────
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Cargo cache
uses: Swatinem/rust-cache@v2
with:
workspaces: ./src-tauri -> target
shared-key: ${{ matrix.platform.label }}
# ──────────────── frontend (needed for tauri::generate_context!) ────────────────
- name: Install npm deps
run: npm ci || npm install
- name: Build frontend
run: npm run build
# ──────────────── checks ────────────────
- name: Rustfmt
working-directory: src-tauri
run: cargo fmt --all -- --check
- name: Clippy
working-directory: src-tauri
run: cargo clippy --all-targets -- -D warnings
- name: Tests
working-directory: src-tauri
run: cargo test --all-targets
- name: Build (debug)
working-directory: src-tauri
run: cargo build