Skip to content

Commit d8426f3

Browse files
committed
only run coverage on main branch
1 parent 8f9db32 commit d8426f3

2 files changed

Lines changed: 10 additions & 23 deletions

File tree

.github/workflows/lib.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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 }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Compile and release
22-
uses: rust-build/rust-build.action@v1.4.4
22+
uses: rust-build/rust-build.action@v1.4.5
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
RUSTTARGET: ${{ matrix.target }}

0 commit comments

Comments
 (0)