This repository has been archived by the owner on Jan 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (107 loc) · 3.5 KB
/
ci.yml
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
name: CI
permissions:
contents: read
pull-requests: read
on:
push:
pull_request:
env:
msrv: '1.70' # keep in sync with Cargo.toml
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
env:
RUSTFLAGS: -Dwarnings
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- id: toolchain-msrv
name: Install Rust ${{env.msrv}} (MSRV)
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{env.msrv}}
components: clippy
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install Rust Beta
uses: dtolnay/rust-toolchain@beta
with:
components: clippy
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Clippy (MSRV)
run: cargo +${{steps.toolchain-msrv.outputs.name}} clippy --all-features --all-targets --workspace && cargo clean
- name: Clippy (stable)
run: cargo +stable clippy --all-features --all-targets --workspace && cargo clean
- name: Clippy (beta)
run: cargo +beta clippy --all-features --all-targets --workspace && cargo clean
- name: Clippy (nightly)
run: cargo +nightly clippy --all-features --all-targets --workspace && cargo clean
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- id: toolchain-msrv
name: Install Rust ${{env.msrv}} (MSRV)
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{env.msrv}}
components: rustfmt
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Install Rust Beta
uses: dtolnay/rust-toolchain@beta
with:
components: rustfmt
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check Formatting (MSRV)
run: cargo +${{steps.toolchain-msrv.outputs.name}} fmt --all --check
- name: Check Formatting (stable)
run: cargo +stable fmt --all --check
- name: Check Formatting (beta)
run: cargo +beta fmt --all --check
- name: Check Formatting (nightly)
run: cargo +nightly fmt --all --check
test:
name: Test ${{matrix.rust-channel}} ${{matrix.os == 'windows' && '(windows)' || ''}}
runs-on: ${{matrix.os}}-latest
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu, windows]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- id: toolchain-msrv
name: Install Rust ${{env.msrv}} (MSRV)
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{env.msrv}}
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Install Rust Beta
uses: dtolnay/rust-toolchain@beta
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
- name: Test (MSRV)
run: cargo +${{steps.toolchain-msrv.outputs.name}} test --all-features --workspace
- name: Test (stable)
run: cargo +stable test --all-features --workspace
- name: Test (beta)
run: cargo +beta test --all-features --workspace
- name: Test (nightly)
run: cargo +nightly test --all-features --workspace