-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.37 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUSTFLAGS: "-Dwarnings"
CARGO_TERM_COLOR: "always"
jobs:
cargo-llvm-cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-llvm-cov
# We are not using nextest in here because of it has some
# shortcomings while working with cargo-llvm-cov and can cause
# false positive results, just use only cargo-llvm-cov
#
# We are using `coverage-ci` profile to reduce binary sizes
# cause of github action runner disk space limitations. This is
# a bit slow but we have to do it because we don't have
# self-hosted runner right now
- name: Generate code coverage
run: |
cargo +nightly llvm-cov \
--profile coverage-ci \
--all-features \
--workspace \
--doctests \
--lcov \
--output-path lcov.info
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v5
if: ${{ !(startsWith(github.head_ref, 'release-plz') || startsWith(github.head_ref, 'dependabot')) }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true