mirror of
https://github.com/haraldh/chainerror.git
synced 2025-01-30 16:46:42 +01:00
ci: use codecov for coverage
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
bb5f372a92
commit
376e133836
55
.github/workflows/coverage.yml
vendored
55
.github/workflows/coverage.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue