-
-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (99 loc) · 2.99 KB
/
ci.yml
File metadata and controls
126 lines (99 loc) · 2.99 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
name: CI
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
NIGHTLY: nightly-2025-08-08
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
style:
name: Style
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install rust nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY }}
- uses: Swatinem/rust-cache@v2
- name: Check spelling
uses: crate-ci/typos@v1.36.0
- name: Install cargo-sort
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-sort
- name: Run cargo-sort
run: |
cargo sort --workspace --grouped --check \
--order package,lib,features,dependencies,target,dev-dependencies,build-dependencies
msrv:
name: Minimum Supported Rust Version / Check All Features
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.82"
- uses: Swatinem/rust-cache@v2
with:
# A stable compiler update should automatically not reuse old caches.
# Add the MSRV as a stable cache key too so bumping it also gets us a
# fresh cache.
shared-key: msrv1.82
- name: Run checks
run: cargo check --all-features
stable:
name: Rust Stable / ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Check All Features
cmd: check --all-features
- name: Check No Default Features
cmd: check --no-default-features
- name: Run Tests
cmd: test --all-features
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install rust stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run checks
run: cargo ${{ matrix.cmd }}
nightly:
name: Rust Nightly / ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Check Formatting
cmd: fmt
components: rustfmt
- name: Check All Features
cmd: check --all-features
- name: Clippy Default Features
cmd: clippy
components: clippy
- name: Clippy All Features
cmd: clippy --all-features
components: clippy
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install rust nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.NIGHTLY }}
components: ${{ matrix.components }}
targets: ${{ matrix.targets }}
- uses: Swatinem/rust-cache@v2
- name: Run checks
run: cargo ${{ matrix.cmd }}