@@ -15,43 +15,30 @@ jobs:
1515 run : cargo build -p svg2gcode
1616 coverage :
1717 runs-on : ubuntu-latest
18+ if : github.ref == 'refs/heads/main'
1819 steps :
1920 - uses : actions/checkout@v4
2021 with :
2122 fetch-depth : 0
22- - uses : dtolnay /rust-toolchain@stable
23+ - uses : Swatinem /rust-cache@v2
2324 with :
24- toolchain : nightly
25- components : llvm-tools-preview
26- - uses : actions-rs/toolchain@v1
25+ cache-all-crates : true
26+ - uses : dtolnay/rust-toolchain@stable
2727 with :
2828 toolchain : nightly
29- override : true
30- profile : minimal
3129 components : llvm-tools-preview
32- - uses : actions-rs/install@v0.1
33- with :
34- crate : grcov
35- version : latest
36- use-tool-cache : true
37- - uses : Swatinem/rust-cache@v2
38- - uses : actions-rs/cargo@v1
39- with :
40- command : build
41- args : -p svg2gcode
30+ - run : cargo install grcov
31+ - run : cargo build -p svg2gcode
4232 env :
4333 RUSTFLAGS : ' -Cinstrument-coverage'
4434 RUSTDOCFLAGS : ' -Cinstrument-coverage'
45- - uses : actions-rs/cargo@v1
46- with :
47- command : test
48- args : --all-features --no-fail-fast -p svg2gcode
35+ LLVM_PROFILE_FILE : ' codecov-instrumentation-%p-%m.profraw'
36+ - run : RUSTFLAGS='-Cinstrument-coverage' cargo test --all-features --no-fail-fast -p svg2gcode
4937 env :
5038 RUSTFLAGS : ' -Cinstrument-coverage'
5139 RUSTDOCFLAGS : ' -Cinstrument-coverage'
5240 LLVM_PROFILE_FILE : ' codecov-instrumentation-%p-%m.profraw'
53- - name : grcov
54- run : grcov . -s . --binary-path ./target/debug/ -t lcov --branch -o lcov.info
41+ - run : grcov . -s . --binary-path ./target/debug/ -t lcov --branch -o lcov.info
5542 - uses : codecov/codecov-action@v4
5643 with :
5744 token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments