-
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.24 KB
/
Copy pathrust-ci.yml
File metadata and controls
53 lines (47 loc) · 1.24 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
# SPDX-License-Identifier: MPL-2.0
# Rust CI - cargo check + clippy + fmt + test on stable and MSRV
name: Rust CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: rust-ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check:
name: cargo check (stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
test:
name: cargo test (${{ matrix.rust }})
runs-on: ubuntu-latest
needs: check
strategy:
fail-fast: false
matrix:
rust:
- "1.85"
- "stable"
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.rust }}
- name: cargo test
run: cargo test --all-targets --no-fail-fast