1
+ on :
2
+ pull_request :
3
+ push :
4
+ branches : [ master ]
5
+
6
+ name : Code checks
7
+
8
+ concurrency :
9
+ group : ${{ github.workflow }}@${{ github.ref }}
10
+ cancel-in-progress : true
11
+
12
+ jobs :
13
+ formatting :
14
+ name : Check formatting
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout repository
18
+ uses : actions/checkout@v4
19
+ - name : Install nightly toolchain
20
+ uses : actions-rs/toolchain@v1
21
+ with :
22
+ toolchain : nightly-2025-01-03
23
+ profile : minimal
24
+ components : rustfmt
25
+ override : true
26
+ - name : Run cargo fmt
27
+ uses : actions-rs/cargo@v1
28
+ with :
29
+ command : fmt
30
+ args : --all --check
31
+
32
+ cargo-deny :
33
+ name : Check cargo-deny rules
34
+ runs-on : ubuntu-latest
35
+
36
+ steps :
37
+ - name : Checkout repository
38
+ uses : actions/checkout@v4
39
+ - name : Run `cargo deny`
40
+ uses : EmbarkStudios/cargo-deny-action@v2
41
+ with :
42
+ # All is set in the config file
43
+ arguments :
44
+ command-arguments : " --hide-inclusion-graph -c .cargo-deny.toml --show-stats -D warnings"
45
+
46
+ lints :
47
+ name : Check Rust lints
48
+ runs-on : ubuntu-latest
49
+ steps :
50
+ - name : Checkout repository
51
+ uses : actions/checkout@v4
52
+ - name : Set up Cargo cache
53
+ uses : ./.github/actions/setup-cargo-cache
54
+ with :
55
+ key : ${{ github.ref }}->${{ github.workflow }}->${{ github.job }}
56
+ github-token : ${{ secrets.GITHUB_TOKEN }}
57
+ - name : Run cargo clippy
58
+ uses : actions-rs/cargo@v1
59
+ with :
60
+ command : clippy
61
+ args : --all --all-targets --all-features -- -D warnings
62
+ - name : Update Cargo cache
63
+ if : success() || failure()
64
+ uses : ./.github/actions/update-cargo-cache
65
+ with :
66
+ key : ${{ github.ref }}->${{ github.workflow }}->${{ github.job }}
67
+
68
+ tests :
69
+ name : Run test suite
70
+ strategy :
71
+ fail-fast : false
72
+ matrix :
73
+ os : [ubuntu-latest, windows-latest, macos-latest]
74
+ runs-on : ${{ matrix.os }}
75
+ steps :
76
+ - name : Checkout repository
77
+ uses : actions/checkout@v4
78
+ - name : Set up Cargo cache
79
+ uses : ./.github/actions/setup-cargo-cache
80
+ with :
81
+ key : ${{ github.ref }}->${{ github.workflow }}->${{ github.job }}->${{ matrix.os }}
82
+ github-token : ${{ secrets.GITHUB_TOKEN }}
83
+ - name : Cargo test
84
+ uses : actions-rs/cargo@v1
85
+ with :
86
+ command : test
87
+ args : --all-targets --all-features
88
+ - name : Update Cargo cache
89
+ if : success() || failure()
90
+ uses : ./.github/actions/update-cargo-cache
91
+ with :
92
+ key : ${{ github.ref }}->${{ github.workflow }}->${{ github.job }}->${{ matrix.os }}
0 commit comments