@@ -12,6 +12,8 @@ name: Continuous integration
12
12
env :
13
13
CARGO_TERM_COLOR : always
14
14
CARGO_INCREMENTAL : 0
15
+ SCCACHE_GHA_ENABLED : " true"
16
+ RUSTC_WRAPPER : " sccache"
15
17
16
18
jobs :
17
19
tests :
@@ -29,58 +31,74 @@ jobs:
29
31
features : unstable quickcheck rayon
30
32
test_all : --all
31
33
bench : true
34
+ name : Tests (Rust ${{ matrix.rust }})
32
35
33
36
steps :
34
37
- uses : actions/checkout@v4
35
- - uses : actions-rs/toolchain@v1
38
+ -
uses :
mozilla-actions/[email protected]
39
+ - id : toolchain
40
+ uses : dtolnay/rust-toolchain@master
36
41
with :
37
- profile : minimal
38
42
toolchain : ${{ matrix.rust }}
39
- override : true
43
+ - name : Configure default rust toolchain
44
+ run : rustup override set ${{steps.toolchain.outputs.name}}
45
+
40
46
- name : MSRV downgrade
41
47
if : matrix.rust == '1.64.0'
42
48
run : |
43
49
cargo generate-lockfile
44
50
cargo update -p hashbrown --precise 0.15.0
45
- - name : Build
46
- run : |
47
- cargo build --verbose --no-default-features
48
- cargo build --verbose --features "${{ matrix.features }}"
49
- - name : Tests
50
- run : |
51
- cargo test --verbose --no-default-features
52
- cargo test ${{ matrix.test_all }} --verbose --features "${{ matrix.features }}"
51
+
52
+ - name : Build with no features
53
+ run : cargo build --verbose --no-default-features
54
+ - name : Test with no features
55
+ run : cargo test --verbose --no-default-features
56
+
57
+ - name : Build with features "${{ matrix.features }}"
58
+ run : cargo build --verbose --features "${{ matrix.features }}"
59
+ - name : Test with features "${{ matrix.features }}"
60
+ run : cargo test ${{ matrix.test_all }} --verbose --features "${{ matrix.features }}"
61
+
53
62
- name : Build benchmarks
54
63
if : ${{ matrix.bench }}
55
64
run : |
56
65
cargo bench --verbose --no-run
57
66
cargo bench --verbose --no-run --all-features
58
67
59
- rustfmt :
68
+ check :
69
+ name : Lints
60
70
runs-on : ubuntu-latest
61
- continue-on-error : true
62
- strategy :
63
- matrix :
64
- include :
65
- - rust : stable
66
- rustfmt : rustfmt
67
-
68
71
steps :
69
72
- uses : actions/checkout@v4
70
- - uses : actions-rs/toolchain@v1
73
+ -
uses :
mozilla-actions/[email protected]
74
+ - name : Install stable toolchain
75
+ uses : dtolnay/rust-toolchain@stable
71
76
with :
72
- profile : minimal
73
- toolchain : ${{ matrix.rust }}
74
- components : ${{ matrix.rustfmt }}
75
- override : true
76
- - name : Rustfmt
77
- if : matrix.rustfmt
77
+ components : rustfmt, clippy
78
+
79
+ - name : Check formatting
78
80
run : cargo fmt -- --check
79
81
82
+ - name : Run clippy
83
+ # The benchmarks target require nightly,
84
+ # so we cannot use --all-targets here.
85
+ run : |
86
+ cargo clippy --all-features \
87
+ --lib --bins --examples --tests \
88
+ -- -D warnings
89
+
90
+ - name : Build docs
91
+ run : cargo doc --no-deps --all-features
92
+ env :
93
+ RUSTDOCFLAGS : " -Dwarnings"
94
+
80
95
miri :
96
+ name : Unsoundness check
97
+ if : github.event_name != 'merge_group'
81
98
runs-on : ubuntu-latest
82
99
steps :
83
100
- uses : actions/checkout@v4
101
+ -
uses :
mozilla-actions/[email protected]
84
102
- uses : dtolnay/rust-toolchain@nightly
85
103
with :
86
104
components : miri
0 commit comments