-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
164 lines (159 loc) · 5.31 KB
/
build-checks.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: build-checks
on:
push:
pull_request:
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build-checks:
permissions:
contents: read # to fetch code (actions/checkout)
checks: write # to create new checks (coverallsapp/github-action)
strategy:
matrix:
include:
- name: clazy
- name: clang-tidy
- name: coverage
runs-on: ubuntu-22.04
name: ${{ matrix.name }}
steps:
- name: Check out repository
uses: actions/checkout@v4.2.1
- name: Install build dependencies
run: tools/debian_buildenv.sh setup
- name: Create build directory
run: mkdir build
- name: Configure (clazy)
if: matrix.name == 'clazy'
# Disable optimizations as workaround for Clang 9 bug: https://bugs.llvm.org/show_bug.cgi?id=45034
run: |
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DWARNINGS_FATAL=ON \
-DQT6=ON \
-DOPTIMIZE=off \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
-DHID=ON \
-DLILV=ON \
-DOPUS=ON \
-DQTKEYCHAIN=ON \
-DVINYLCONTROL=ON \
-DFFMPEG=ON \
-DKEYFINDER=ON \
-DLOCALECOMPARE=ON \
-DMAD=ON \
-DMODPLUG=ON \
-DWAVPACK=ON \
..
working-directory: build
env:
LD: clang++
CC: clang
CXX: clazy
- name: Configure (clang-tidy)
if: matrix.name == 'clang-tidy'
run: |
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCLANG_TIDY=clang-tidy \
-DWARNINGS_FATAL=ON \
-DQT6=ON \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
-DHID=ON \
-DLILV=ON \
-DOPUS=ON \
-DQTKEYCHAIN=ON \
-DVINYLCONTROL=ON \
-DFFMPEG=ON \
-DKEYFINDER=ON \
-DLOCALECOMPARE=ON \
-DMAD=ON \
-DMODPLUG=ON \
-DWAVPACK=ON \
..
working-directory: build
env:
LD: clang++
CC: clang
CXX: clang++
- name: Configure (coverage)
if: matrix.name == 'coverage'
run: |
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DOPTIMIZE=off \
-DQT6=ON \
-DQML=ON \
-DCOVERAGE=ON \
-DWARNINGS_FATAL=OFF \
-DDEBUG_ASSERTIONS_FATAL=OFF \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
-DHID=ON \
-DLILV=ON \
-DOPUS=ON \
-DQTKEYCHAIN=ON \
-DVINYLCONTROL=ON \
-DFFMPEG=ON \
-DKEYFINDER=ON \
-DLOCALECOMPARE=ON \
-DMAD=ON \
-DMODPLUG=ON \
-DWAVPACK=ON \
..
working-directory: build
- name: Set up problem matcher
uses: ammaraskar/gcc-problem-matcher@0.3.0
# Work around https://github.com/actions/runner-images/issues/8659
- name: "Remove GCC 13 from runner image (workaround)"
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35* libc6-dev=2.35* libstdc++6=12.3.0-1ubuntu1~22.04 libgcc-s1=12.3.0-1ubuntu1~22.04
- name: Build
# Do not abort on errors and build/check the whole project
run: cmake --build . -j $(nproc) -- --keep-going
working-directory: build
env:
CLAZY_CHECKS: level2,container-inside-loop,heap-allocated-small-trivial-type,isempty-vs-count,qhash-with-char-pointer-key,qproperty-type-mismatch,tr-non-literal,no-rule-of-two-soft,no-non-pod-global-static,no-qproperty-without-notify,no-qstring-allocations,no-function-args-by-value,no-copyable-polymorphic,no-ctor-missing-parent-argument,no-missing-qobject-macro,no-rule-of-three,no-returning-void-expression
CLAZY_IGNORE_DIRS: lib/.*
- name: "Test"
if: matrix.name == 'coverage'
run: ctest --timeout 45
working-directory: build
env:
# Render analyzer waveform tests to an offscreen buffer
QT_QPA_PLATFORM: ${{ matrix.qt_qpa_platform }}
GTEST_COLOR: 1
# Only use single thread to prevent *.gcna files from overwriting each other
CTEST_PARALLEL_LEVEL: 1
CTEST_OUTPUT_ON_FAILURE: 1
- name: "Generate Coverage Report"
if: matrix.name == 'coverage'
run: >-
lcov
--capture
--directory .
--base-directory ..
--include "${PWD%/*}/src/*"
--exclude "${PWD%/*}/src/test/*"
--exclude "${PWD%/*}/build/*"
--exclude "${PWD%/*}/lib/*"
--output-file lcov.info
working-directory: build
- name: "Upload Coverage Report to coveralls.io"
if: matrix.name == 'coverage'
continue-on-error: true
uses: coverallsapp/github-action@v2.3.4
with:
flag-name: ubuntu-22.04
path-to-lcov: build/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}