Repository navigation
98 lines (84 loc) · 3.03 KB
/
Copy pathquality.yml
File metadata and controls
98 lines (84 loc) · 3.03 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Quality
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage-sonar:
name: Coverage and SonarQube
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
submodules: recursive
- name: Set up C++ toolchain
uses: ./.github/actions/setup-cpp
with:
cache-key: coverage
extra-packages: gcovr
- name: Configure coverage build
run: cmake --preset linux-gcc-coverage
- name: Build coverage tests
run: cmake --build --preset linux-gcc-coverage-tests --parallel
- name: Run coverage tests
run: ctest --preset linux-gcc-coverage-nonperformance
- name: Generate and enforce coverage report
run: |
mkdir -p build/linux-gcc-coverage/coverage
gcovr build/linux-gcc-coverage \
--root . \
--object-directory build/linux-gcc-coverage \
--filter '^uv/' \
--filter '^src/' \
--exclude '^tests/' \
--exclude '^external/' \
--exclude '^build/' \
--exclude '.*/vcpkg_installed/.*' \
--exclude '.*/usr/include/.*' \
--gcov-executable gcov-13 \
--gcov-ignore-parse-errors negative_hits.warn_once_per_file \
--gcov-ignore-errors=no_working_dir_found \
--html-details build/linux-gcc-coverage/coverage/coverage.html \
--lcov build/linux-gcc-coverage/coverage/coverage.info \
--xml-pretty \
--xml build/linux-gcc-coverage/coverage/coverage.xml \
--print-summary \
--fail-under-line 85
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
continue-on-error: true
with:
files: build/linux-gcc-coverage/coverage/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: gcc
name: gcc-coverage
fail_ci_if_error: false
- name: Run SonarQube analysis
if: >-
github.actor != 'dependabot[bot]' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: gcc-coverage-report
path: build/linux-gcc-coverage/coverage
retention-days: 14
if-no-files-found: warn
- name: Report ccache statistics
if: always()
run: ccache --show-stats