-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (88 loc) · 2.19 KB
/
Copy pathrust.yml
File metadata and controls
116 lines (88 loc) · 2.19 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
---
name: rust
on:
pull_request:
paths:
- '.github/workflows/rust.yml'
- '.rustfmt.toml'
- 'rust-toolchain.toml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
push:
branches:
- main
- wip/next
paths:
- '.github/workflows/rust.yml'
- '.rustfmt.toml'
- 'rust-toolchain.toml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_TERM_VERBOSE: true
jobs:
check:
name: cargo fmt --check and clippy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v6
- name: set up rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
rustflags: ''
- name: check formatting
run: cargo fmt --check
- name: cargo clippy
run: cargo clippy
msrv:
name: msrv
runs-on: ubuntu-latest
outputs:
msrv: ${{ steps.msrv.outputs.msrv }}
steps:
- name: checkout
uses: actions/checkout@v6
- name: install cargo-msrv
uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
- name: show cargo-msrv version
run: cargo msrv --version
- name: get msrv
run: |
msrv=$(cargo msrv show --output-format minimal)
echo "msrv=$msrv" >> "$GITHUB_OUTPUT"
id: msrv
- name: show msrv
run: echo ${{ steps.msrv.outputs.msrv }}
test:
name: cargo check, build and test
runs-on: ubuntu-latest
needs: msrv
strategy:
matrix:
toolchain:
- null # this will use rust-toolchain.toml
- ${{ needs.msrv.outputs.msrv }}
steps:
- name: checkout
uses: actions/checkout@v6
- name: set up rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- name: cargo check
run: cargo check
- name: cargo build
run: cargo build
- name: cargo test
run: cargo test
...