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 branches: [main, development]
10 pull_request:
11 workflow_dispatch:
12
13 concurrency:
14 group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15 cancel-in-progress: true
16
17 env:
18 CARGO_TERM_COLOR: always
19
20 jobs:
21 fmt:
22 name: Format
23 runs-on: macos-26
24
25 steps:
26 - name: Checkout
27 uses: actions/checkout@v6
28
29 - name: Install Rust toolchain
30 uses: dtolnay/rust-toolchain@stable
31 with:
32 components: rustfmt
33
34 - name: Setup Rust cache
35 uses: Swatinem/rust-cache@v2
36 with:
37 key: fmt
38
39 - name: Check formatting
40 run: cargo fmt -- --check
41
42 clippy:
43 name: Clippy — ${{ matrix.name }}
44 runs-on: ${{ matrix.os }}
45 strategy:
46 fail-fast: false
47 matrix:
48 include:
49 - name: macOS aarch64
50 os: macos-26
51 target: aarch64-apple-darwin
52
53 - name: macOS x86_64
54 os: macos-26
55 target: x86_64-apple-darwin
56
57 - name: Linux x86_64
58 os: ubuntu-latest
59 target: x86_64-unknown-linux-gnu
60
61 - name: Windows x86_64
62 os: windows-latest
63 target: x86_64-pc-windows-msvc
64
65 steps:
66 - name: Checkout
67 uses: actions/checkout@v6
68
69 - name: Install Rust toolchain
70 uses: dtolnay/rust-toolchain@stable
71 with:
72 targets: ${{ matrix.target }}
73 components: clippy
74
75 - name: Setup Rust cache
76 uses: Swatinem/rust-cache@v2
77 with:
78 key: clippy-${{ matrix.target }}
79
80 - name: Clippy
81 run: cargo clippy --locked --tests --target ${{ matrix.target }} -- -D warnings
82
83 test:
84 name: Test — ${{ matrix.name }}
85 runs-on: ${{ matrix.os }}
86 strategy:
87 fail-fast: false
88 matrix:
89 include:
90 - name: macOS aarch64
91 os: macos-26
92 target: aarch64-apple-darwin
93
94 - name: macOS x86_64
95 os: macos-26
96 target: x86_64-apple-darwin
97
98 - name: Linux x86_64
99 os: ubuntu-latest
100 target: x86_64-unknown-linux-gnu
101
102 - name: Windows x86_64
103 os: windows-latest
104 target: x86_64-pc-windows-msvc
105
106 steps:
107 - name: Checkout
108 uses: actions/checkout@v6
109
110 - name: Install Rust toolchain
111 uses: dtolnay/rust-toolchain@stable
112 with:
113 targets: ${{ matrix.target }}
114
115 - name: Setup Rust cache
116 uses: Swatinem/rust-cache@v2
117 with:
118 key: test-${{ matrix.target }}
119
120 - name: Test
121 run: cargo test --locked --target ${{ matrix.target }}