@@ -3,97 +3,91 @@ name: CI checks
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- lint :
7
- name : Lint
8
- runs-on : ubuntu-latest
9
-
6
+ test-msrv :
7
+ name : Test MSRV on ${{ matrix.os }}
8
+ runs-on : ${{ matrix.os }}
9
+ strategy :
10
+ matrix :
11
+ os : [ubuntu-latest, windows-latest, macos-12]
10
12
steps :
11
- - uses : actions/checkout@v1
12
- - uses : actions-rs/toolchain@v1
13
- with :
14
- toolchain : 1.51.0
15
- override : true
16
-
17
- # Ensure all code has been formatted with rustfmt
18
- - run : rustup component add rustfmt
19
- - name : Check formatting
20
- uses : actions-rs/cargo@v1
21
- with :
22
- command : fmt
23
- args : -- --check --color always
13
+ - uses : actions/checkout@v4
14
+ - name : Run tests
15
+ run : cargo test --verbose
16
+ - name : Verify working directory is clean
17
+ run : git diff --exit-code
24
18
25
- test :
26
- name : Test on ${{ matrix.os }}
19
+ test-latest :
20
+ name : Test latest on ${{ matrix.os }}
27
21
runs-on : ${{ matrix.os }}
28
22
strategy :
29
23
matrix :
30
- os : [ubuntu-latest, windows-latest, macOS-latest]
31
-
24
+ os : [ubuntu-latest, windows-latest, macos-latest]
32
25
steps :
33
- - uses : actions/checkout@v1
34
- - uses : actions-rs/toolchain@v1
35
- with :
36
- toolchain : 1.51.0
37
- override : true
38
- - name : cargo fetch
39
- uses : actions-rs/cargo@v1
40
- with :
41
- command : fetch
42
- - name : Build tests
43
- uses : actions-rs/cargo@v1
44
- with :
45
- command : build
46
- args : --verbose --tests
26
+ - uses : actions/checkout@v4
27
+ - uses : dtolnay/rust-toolchain@stable
28
+ id : toolchain
29
+ - run : rustup override set ${{steps.toolchain.outputs.name}}
30
+ - name : Remove lockfile to build with latest dependencies
31
+ run : rm Cargo.lock
47
32
- name : Run tests
48
- uses : actions-rs/cargo@v1
33
+ run : cargo test --verbose
34
+ - name : Verify working directory is clean (excluding lockfile)
35
+ run : git diff --exit-code ':!Cargo.lock'
36
+
37
+ clippy :
38
+ name : Clippy (MSRV)
39
+ runs-on : ubuntu-latest
40
+ steps :
41
+ - uses : actions/checkout@v4
42
+ - name : Clippy check
43
+ uses : actions-rs/clippy-check@v1
49
44
with :
50
- command : test
51
- args : --verbose
45
+ name : Clippy (MSRV)
46
+ token : ${{ secrets.GITHUB_TOKEN }}
47
+ args : --all-features --all-targets -- -D warnings
52
48
53
49
codecov :
54
50
name : Code coverage
55
51
runs-on : ubuntu-latest
52
+ container :
53
+ image : xd009642/tarpaulin:develop-nightly
54
+ options : --security-opt seccomp=unconfined
56
55
57
56
steps :
58
- - uses : actions/checkout@v1
59
- - uses : actions-rs/toolchain@v1
60
- with :
61
- toolchain : stable
62
- override : true
63
- - name : Install cargo-tarpaulin
64
- uses : actions-rs/cargo@v1
65
- with :
66
- command : install
67
- args : cargo-tarpaulin
57
+ - uses : actions/checkout@v4
58
+ - uses : dtolnay/rust-toolchain@stable
59
+ id : toolchain
60
+ - run : rustup override set ${{steps.toolchain.outputs.name}}
68
61
- name : Generate coverage report
69
- uses : actions-rs/cargo@v1
70
- with :
71
- command : tarpaulin
72
- args : --release --timeout 180 --out Xml
62
+ run : >
63
+ cargo tarpaulin
64
+ --engine llvm
65
+ --release
66
+ --timeout 180
67
+ --out xml
73
68
- name : Upload coverage to Codecov
74
- uses : codecov/codecov-action@v1.0.3
69
+ uses : codecov/codecov-action@v4.5.0
75
70
with :
76
- token : ${{secrets.CODECOV_TOKEN}}
71
+ token : ${{ secrets.CODECOV_TOKEN }}
77
72
78
73
doc-links :
79
- name : Nightly lint
74
+ name : Intra-doc links
80
75
runs-on : ubuntu-latest
81
-
82
76
steps :
83
- - uses : actions/checkout@v1
77
+ - uses : actions/checkout@v4
84
78
- uses : actions-rs/toolchain@v1
85
79
with :
86
80
toolchain : nightly
87
81
override : true
88
- - name : cargo fetch
89
- uses : actions-rs/cargo@v1
90
- with :
91
- command : fetch
92
-
93
- # Ensure intra-documentation links all resolve correctly
82
+ - run : cargo fetch
94
83
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
95
84
- name : Check intra-doc links
96
- uses : actions-rs/cargo@v1
97
- with :
98
- command : doc
99
- args : --document-private-items
85
+ run : cargo doc --document-private-items
86
+
87
+ fmt :
88
+ name : Rustfmt
89
+ runs-on : ubuntu-latest
90
+ steps :
91
+ - uses : actions/checkout@v4
92
+ - name : Check formatting
93
+ run : cargo fmt -- --check
0 commit comments