-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.47 KB
/
coverage.yml
File metadata and controls
54 lines (46 loc) · 1.47 KB
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
49
50
51
52
53
54
name: Coverage
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
coverage:
name: Generate Coverage Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Generate coverage report
run: |
cargo llvm-cov --lib -p tp-lib-core \
--lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unittests
name: tp-lib-core-coverage
- name: Generate HTML report (for artifacts)
if: always()
run: |
cargo llvm-cov --lib -p tp-lib-core \
--html --output-dir coverage-report
- name: Upload HTML report as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage-report/
retention-days: 30