1 name: CI
2
3 # Runs on every push.
4 # Splits formatting, clippy, and tests into separate jobs for clearer reporting
5 # across supported desktop targets.
6
7 on:
8 push:
9 pull_request:
10 workflow_dispatch:
11
12 env:
13 CARGO_TERM_COLOR: always
14
15 jobs:
16 fmt:
17 name: Format
18 runs-on: macos-26
19
20 steps:
21 - name: Checkout
22 uses: actions/checkout@v6
23
24 - name: Install Rust toolchain
25 uses: dtolnay/rust-toolchain@stable
26 with:
27 components: rustfmt
28
29 - name: Setup Rust cache
30 uses: Swatinem/rust-cache@v2
31 with:
32 key: fmt
33
34 - name: Check formatting
35 run: cargo fmt -- --check
36
37 clippy:
38 name: Clippy — ${{ matrix.name }}
39 runs-on: ${{ matrix.os }}
40 strategy:
41 fail-fast: false
42 matrix:
43 include:
44 - name: macOS aarch64
45 os: macos-26
46 target: aarch64-apple-darwin
47
48 - name: macOS x86_64
49 os: macos-26
50 target: x86_64-apple-darwin
51
52 - name: Linux x86_64
53 os: ubuntu-latest
54 target: x86_64-unknown-linux-gnu
55
56 - name: Windows x86_64
57 os: windows-latest
58 target: x86_64-pc-windows-msvc
59
60 steps:
61 - name: Checkout
62 uses: actions/checkout@v6
63
64 - name: Install Rust toolchain
65 uses: dtolnay/rust-toolchain@stable
66 with:
67 targets: ${{ matrix.target }}
68 components: clippy
69
70 - name: Setup Rust cache
71 uses: Swatinem/rust-cache@v2
72 with:
73 key: clippy-${{ matrix.target }}
74
75 - name: Clippy
76 run: cargo clippy --tests --target ${{ matrix.target }} -- -D warnings
77
78 test:
79 name: Test — ${{ matrix.name }}
80 runs-on: ${{ matrix.os }}
81 strategy:
82 fail-fast: false
83 matrix:
84 include:
85 - name: macOS aarch64
86 os: macos-26
87 target: aarch64-apple-darwin
88
89 - name: macOS x86_64
90 os: macos-26
91 target: x86_64-apple-darwin
92
93 - name: Linux x86_64
94 os: ubuntu-latest
95 target: x86_64-unknown-linux-gnu
96
97 - name: Windows x86_64
98 os: windows-latest
99 target: x86_64-pc-windows-msvc
100
101 steps:
102 - name: Checkout
103 uses: actions/checkout@v6
104
105 - name: Install Rust toolchain
106 uses: dtolnay/rust-toolchain@stable
107 with:
108 targets: ${{ matrix.target }}
109
110 - name: Setup Rust cache
111 uses: Swatinem/rust-cache@v2
112 with:
113 key: test-${{ matrix.target }}
114
115 - name: Test
116 run: cargo test --locked --target ${{ matrix.target }}