Skip to content

Commit

Permalink
Add codecov step to test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasPius committed Apr 4, 2024
1 parent a90508f commit 752b364
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
push:
branches:
- master
Expand Down Expand Up @@ -31,13 +31,45 @@ jobs:
with:
command: fmt
args: --all -- --check

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview

- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile

- name: cargo llvm-cov
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info

- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,RUST

test:
name: Test
runs-on: ubuntu-latest
Expand All @@ -57,13 +89,13 @@ jobs:
with:
command: test
args: --no-run --all-features

- name: Ensure all doc tests compile
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --doc

- name: Run safe tests
uses: actions-rs/cargo@v1
with:
Expand Down

0 comments on commit 752b364

Please sign in to comment.