ci: use codecov for coverage

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2023-07-27 12:32:37 +02:00
parent bb5f372a92
commit 376e133836
Signed by: harald
GPG key ID: 900F3C4971086004

View file

@ -1,22 +1,43 @@
name: coverage
name: coverage
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- created
on: [ "push" , "pull_request" ]
jobs:
test:
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin
options: --security-opt seccomp=unconfined
name: coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --workspace --timeout 120 --out Lcov --output-dir coverage
- name: Upload to coveralls
uses: coverallsapp/github-action@master
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
target: x86_64-unknown-linux-gnu
toolchain: nightly
components: llvm-tools-preview
- name: Install cargo-llvm-cov
run: >
curl -LsSf 'https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.23/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz'
| tar xzf -
&& mv cargo-llvm-cov $HOME/.cargo/bin
- name: Run cargo-llvm-cov
run: cargo llvm-cov --doctests --all --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./
fail_ci_if_error: false
files: ./lcov.info
verbose: true