8
8
branches :
9
9
- master
10
10
11
+ env :
12
+ GRCOV_VERSION : " 0.8.20"
13
+
11
14
jobs :
12
15
clippy-rustfmt :
13
16
14
17
runs-on : ubuntu-latest
15
18
16
19
steps :
17
- - uses : actions/checkout@v2
20
+ - uses : actions/checkout@v4
18
21
19
22
- name : Install stable
20
- uses : actions-rs/ toolchain@v1
23
+ uses : dtolnay/rust- toolchain@stable
21
24
with :
22
- profile : minimal
23
- toolchain : stable
24
- override : true
25
- components : clippy, rustfmt
25
+ components : rustfmt, clippy
26
26
27
27
- name : Run rustfmt
28
- uses : actions-rs/cargo@v1
29
- with :
30
- command : fmt
31
- args : -- --check --verbose
28
+ run :
29
+ cargo fmt --all -- --check --verbose
32
30
33
31
- name : Run cargo clippy
34
- uses : actions-rs/clippy-check@v1
35
- with :
36
- token : ${{ secrets.GITHUB_TOKEN }}
37
- args : --all-features -- -D warnings
32
+ run : cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
38
33
39
34
code-coverage :
40
35
41
36
runs-on : ubuntu-latest
42
37
43
38
steps :
44
- - uses : actions/checkout@v2
45
-
46
- - uses : actions-rs/toolchain@v1
47
- with :
48
- toolchain : nightly
49
- override : true
50
-
51
- - uses : actions-rs/cargo@v1
52
- with :
53
- command : test
54
- args : --all-features --no-fail-fast
55
- env :
56
- CARGO_INCREMENTAL : ' 0'
57
- RUSTFLAGS : >
58
- -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
59
- -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests
60
- RUSTDOCFLAGS : >
61
- -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code
62
- -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests
63
-
64
- - id : coverage
65
- uses :
actions-rs/[email protected]
66
-
67
- - name : Coveralls upload
68
- uses : coverallsapp/github-action@master
69
- with :
70
- github-token : ${{ secrets.GITHUB_TOKEN }}
71
- path-to-lcov : ${{ steps.coverage.outputs.report }}
39
+
40
+ - uses : actions/checkout@v4
41
+
42
+ - name : Install Rust stable
43
+ uses : dtolnay/rust-toolchain@stable
44
+ with :
45
+ components : llvm-tools-preview
46
+
47
+ - name : Install grcov
48
+ env :
49
+ GRCOV_LINK : https://github.com/mozilla/grcov/releases/download
50
+ run : |
51
+ curl -L "$GRCOV_LINK/v$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" |
52
+ tar xj -C $HOME/.cargo/bin
53
+
54
+ - name : Run tests
55
+ env :
56
+ RUSTFLAGS : " -Cinstrument-coverage"
57
+ LLVM_PROFILE_FILE : " json-structural-diff-%p-%m.profraw"
58
+ run : |
59
+ cargo test --verbose
60
+
61
+ - name : Get coverage data for codecov
62
+ run : |
63
+ grcov . --binary-path ./target/debug/ -s . -t lcov --branch \
64
+ --ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info
65
+
66
+ - name : Codecov upload
67
+ uses : codecov/codecov-action@v4
68
+ with :
69
+ files : lcov.info
70
+ token : ${{ secrets.CODECOV_TOKEN }}
72
71
73
72
tests :
74
73
@@ -79,14 +78,10 @@ jobs:
79
78
runs-on : ${{ matrix.platform }}
80
79
81
80
steps :
82
- - uses : actions/checkout@v2
81
+ - uses : actions/checkout@v4
83
82
84
83
- name : Install stable
85
- uses : actions-rs/toolchain@v1
86
- with :
87
- profile : minimal
88
- toolchain : stable
89
- override : true
84
+ uses : dtolnay/rust-toolchain@stable
90
85
91
86
- name : Build
92
87
run : |
0 commit comments