-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (77 loc) · 2.39 KB
/
ci.yml
File metadata and controls
84 lines (77 loc) · 2.39 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
# PR / push CI for lightweight quality gates. Runs cargo-deny (license /
# advisory) and cargo-fmt on every touched-Rust change so formatting drift and
# license issues are caught at PR time.
#
# Clippy and cargo-test used to run here as `clippy + test (macOS ARM64)` on
# the self-hosted Apple Silicon runner, but each run consumed ~15 minutes of
# that single shared runner per PR push. Those gates were moved to the release
# workflow (`release.yml::build-macos`), which now runs fmt/clippy/test before
# producing signed artifacts. Local developers should run `make verify` (or
# `make verify-clean` for a cache-clear pass) before pushing to catch
# regressions that release-time CI will otherwise surface.
#
# Note on CUDA gating: CUDA verification stays exclusive to release.yml because
# it requires a Linux self-hosted runner (currently only the GB10 node used for
# release builds). Adding a PR-level CUDA gate would double runner cost for
# limited additional safety on PRs that don't touch CUDA-specific code paths.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
rust:
- '**/*.rs'
- '**/Cargo.toml'
- 'Cargo.lock'
- 'deny.toml'
- '.github/workflows/ci.yml'
deny:
name: cargo-deny
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
log-level: warn
fmt:
name: cargo-fmt
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check