-
Notifications
You must be signed in to change notification settings - Fork 73
77 lines (64 loc) · 1.95 KB
/
coverage.yml
File metadata and controls
77 lines (64 loc) · 1.95 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
name: Code Coverage
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
run-code-coverage:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name : Install lcov
run: |
sudo apt-get -y update
sudo apt-get -y install lcov
shell: bash
- name: Install MESA on ${{ runner.os }} with SDK 26.3.2 and coverage enabled
uses: ./.github/actions/install-mesa
env:
WITH_COVERAGE: yes
with:
sdk: "26.3.2"
- name: Run gcov
run: |
gcov **/*.gcno
shell: bash
- name: Generate html with lcov
run: |
lcov --gcov-tool gcov --ignore-errors negative,inconsistent,mismatch --capture --directory . --output-file coverage.info
genhtml --ignore-errors empty,source --synthesize-missing --output-directory .htmlcov coverage.info
shell: bash
- name: Extract coverage percentage
id: extract
run: |
echo "coverage=$(awk -F'[<>]' '/headerCovTableEntryLo/{gsub(" ", ""); print $3}' .htmlcov/index.html | tail -n 1)" >> $GITHUB_OUTPUT
shell: bash
env:
GITHUB_ENV: ${{ github.env }}
- name: Make coverage badge
uses: RubbaBoy/BYOB@v1.3.0
with:
NAME: coverage
LABEL: 'coverage'
STATUS: ${{ steps.extract.outputs.coverage }}
COLOR: green
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Save the html folder as an artifact
uses: actions/upload-pages-artifact@v3
with:
path: './.htmlcov/'
- name: Deploy to Github Pages
uses: actions/deploy-pages@v4
id: deployment