48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
name: Test Coverage
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
test:
|
|
name: Measure Test Coverage
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Polaris
|
|
uses: actions/checkout@v4
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: llvm-tools-preview
|
|
- name: Install grcov
|
|
run: cargo install grcov
|
|
- name: Run tests
|
|
run: cargo test --no-fail-fast
|
|
env:
|
|
RUSTFLAGS: "-Cinstrument-coverage"
|
|
- name: Gather coverage results
|
|
run: >
|
|
grcov
|
|
.
|
|
-t lcov
|
|
-o coverage.txt
|
|
--llvm
|
|
--branch
|
|
--ignore-not-existing
|
|
--binary-path ./target/debug/
|
|
--excl-line "#\[derive\("
|
|
--excl-br-line "#\[derive\("
|
|
--excl-start "mod tests \{"
|
|
--excl-br-start "mod tests \{"
|
|
- name: Upload Results
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
fail_ci_if_error: true
|
|
verbose: true
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|