Repository navigation
96 lines (81 loc) · 3.22 KB
/
Copy pathci.yml
File metadata and controls
96 lines (81 loc) · 3.22 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
# ─────────────────────────────────────────────────────────────────────────────
# Job 1: Formatting, Linting, and Tests
# Runs on Ubuntu (fast & cheap). Catches style issues, code smells, and
# regressions before the cross-platform matrix even starts.
# ─────────────────────────────────────────────────────────────────────────────
quality:
name: Code Quality & Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Linux system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libayatana-appindicator3-dev \
libssl-dev \
pkg-config \
libasound2-dev \
libxdo-dev
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Lint with Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run Tests
run: cargo test --all-targets
# ─────────────────────────────────────────────────────────────────────────────
# Job 2: Cross-Platform Compilation Check
# Ensures a contributor working on one OS doesn't accidentally introduce
# platform-specific breakage. Uses `cargo check` instead of `cargo build`
# to save CI minutes (no linking, no binary output).
# ─────────────────────────────────────────────────────────────────────────────
platform-check:
name: Compile Check (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux
- os: macos-latest
name: macOS
- os: windows-latest
name: Windows
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.name }}
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libayatana-appindicator3-dev \
libssl-dev \
pkg-config \
libasound2-dev \
libxdo-dev
- name: Cargo Check
run: cargo check --all-targets