-
Notifications
You must be signed in to change notification settings - Fork 30
53 lines (43 loc) · 1.21 KB
/
code-coverage.yml
File metadata and controls
53 lines (43 loc) · 1.21 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
name: Code Coverage
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# List compiler version
- name: List compiler and gcov version
run: |
gcc --version
gcov --version
# Install gcovr for coverage report generation
- name: Install gcovr
run: |
sudo apt-get update
sudo apt-get install -y gcovr
# Checkout wolfssl
- name: Checkout wolfssl
uses: actions/checkout@v4
with:
repository: wolfssl/wolfssl
path: wolfssl
# Run coverage
- name: Build and run tests with coverage
run: cd test && make coverage WOLFSSL_DIR=../wolfssl
# Display coverage summary in the action log
- name: Display coverage summary
run: |
echo "=== Coverage Summary ==="
cd test
gcovr Build --root .. --filter '\.\./src/.*' --filter '\.\./wolfhsm/.*' --print-summary
# Upload coverage report as artifact
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 30