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