@@ -14,38 +14,22 @@ jobs:
1414 runs-on : ubuntu-latest
1515 steps :
1616 - uses : actions/checkout@v4
17- - name : Set up toolchain
18- uses : actions-rs/toolchain@v1
19- with :
20- profile : minimal
21- toolchain : stable
22- override : true
23- components : rustfmt, llvm-tools-preview
17+ - name : Install Nix
18+ uses : cachix/install-nix-action@v26
2419 - name : Build
25- uses : actions-rs/cargo@v1
26- with :
27- command : build
28- args : --release
29- env :
30- CARGO_INCREMENTAL : " 0"
31- RUSTFLAGS : " -Cinstrument-coverage"
32- RUSTDOCFLAGS : " -Cinstrument-coverage"
20+ run : nix develop .#codecov -c cargo build --release
3321 - name : Test
34- uses : actions-rs/cargo@v1
35- with :
36- command : test
37- args : --all-features --no-fail-fast
38- env :
39- CARGO_INCREMENTAL : " 0"
40- RUSTFLAGS : " -Cinstrument-coverage"
41- RUSTDOCFLAGS : " -Cinstrument-coverage"
22+ run : nix develop .#codecov -c cargo test --all-features --no-fail-fast --tests
4223 - name : Install grcov
43- run : if [[ ! -e ~/. cargo/bin/grcov ]]; then cargo install grcov; fi
24+ run : nix develop .#codecov -c cargo install grcov
4425 - name : Generate coverage
45- run : grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
26+ run : nix develop .#codecov -c grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
4627 - name : Upload coverage to Codecov
47- uses : codecov/codecov-action@v3
28+ uses : codecov/codecov-action@v4
4829 with :
4930 files : ./coverage.lcov
5031 flags : rust
51- fail_ci_if_error : true
32+ # TODO: set true when CODECOV_TOKEN is set
33+ fail_ci_if_error : false
34+ env :
35+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
0 commit comments