forked from locka99/opcua
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.19 KB
/
ci_code_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
name: Determine code coverage
'on':
workflow_call: null
jobs:
cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test with profiling data
run: cargo test
env:
CARGO_INCREMENTAL: 0
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw'
RUSTFLAGS: '-Cinstrument-coverage'
- name: Install grcov fast
uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- name: Add llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: Create lcov output dir
run: |
mkdir target/coverage
- name: Generate lcov from profiling data
run: grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '**/generated/**/*' --ignore '**/integration/**/*' --ignore '**/tests/**/*' --ignore '../*' --ignore "/*" -o target/coverage/tests.lcov
- name: Upload lcov to codecov.io
uses: codecov/codecov-action@v4
with:
files: target/coverage/*.lcov
- name: Wipe stray profiling files
run: find . -type f -name "*.profraw"