-
Notifications
You must be signed in to change notification settings - Fork 2
150 lines (129 loc) · 4.07 KB
/
Copy pathci.yml
File metadata and controls
150 lines (129 loc) · 4.07 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: CI
# Doc-only churn does not exercise any of the rust gates below, so paths-ignore
# skips runs whose entire diff is markdown / vault / license edits. Keeps the
# CI cost down without losing real signal.
concurrency:
group: ci-${{ github.ref_name }}
cancel-in-progress: true
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '**/*.md'
- 'ObsidianVault/**'
- 'LICENSE'
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
- 'ObsidianVault/**'
- 'LICENSE'
# Least privilege at the top level.
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: "0"
jobs:
fmt-clippy:
name: fmt + clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust (toolchain pinned by rust-toolchain.toml)
# `dtolnay/rust-toolchain` always installs whatever its `toolchain:`
# input resolves to and attaches `components:` to THAT toolchain —
# independent of `rust-toolchain.toml`. Cargo then switches to the
# toml's pinned channel and finds no components there. rustup is
# preinstalled on ubuntu-latest, `rustup show` triggers the
# toml-driven install, then `component add` lands on the active
# pinned toolchain.
run: |
rustup show
rustup component add rustfmt clippy
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
with:
key: fmt-clippy
- name: Install Linux GUI deps
# `dynobox-gui` (eframe + rfd) brings GUI dev libraries into the
# workspace; clippy compiles every crate so the deps need to be
# present even on the lint job.
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libwayland-dev \
libssl-dev
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy -D warnings
run: cargo clippy --workspace --all-targets --locked -- -D warnings
cargo-deny:
name: cargo-deny
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install cargo-deny
uses: taiki-e/install-action@v2.87.1
with:
tool: cargo-deny
- name: Cache cargo-deny advisory DB
uses: actions/cache@v6
with:
path: ~/.cargo/advisory-dbs
key: cargo-deny-advisory-db-${{ runner.os }}-v1
restore-keys: |
cargo-deny-advisory-db-${{ runner.os }}-
- name: cargo deny check
# Advisories (RUSTSEC), license policy, banned crates, and dependency
# sources — config in deny.toml at the repo root.
run: cargo deny check
test:
name: test (${{ matrix.os }})
needs: [fmt-clippy, cargo-deny]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust (toolchain pinned by rust-toolchain.toml)
run: rustup show
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
with:
key: test-${{ matrix.os }}
- name: Install Linux GUI deps
# `dynobox-gui` (eframe + rfd) GUI dev libs needed for the
# workspace test compile on bare ubuntu runners.
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxkbcommon-dev \
libwayland-dev \
libssl-dev
- name: cargo test --workspace
run: cargo test --workspace --locked