Skip to content

Commit

Permalink
👷 Use Tarpaulin for coverage (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 authored Apr 19, 2024
1 parent 37094de commit 0bb44d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '**/Cargo.toml'
- '**/Cargo.lock'
schedule:
- cron: '0 16 * * 6'
- cron: '0 0 * * *'

jobs:
security_audit:
Expand Down
33 changes: 22 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,42 @@ jobs:
with:
command: check

test:
name: Test Suite
coverage:
name: Test Coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin
options: --security-opt seccomp=unconfined
strategy:
matrix:
flags:
- lib
- doc
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v2
# - run: cargo install tarpaulin
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
- uses: actions-rs/[email protected]
command: tarpaulin
args: --${{ matrix.flags }} --all-features --workspace --out xml
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4.1.0
if: "!contains(github.event.head_commit.message, '[skip codecov]')"
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: senseshift/rshapes
files: cobertura.xml
flags: ${{ matrix.flags }}
fail_ci_if_error: true

fmt:
name: Rustfmt
Expand Down

0 comments on commit 0bb44d6

Please sign in to comment.