-
Notifications
You must be signed in to change notification settings - Fork 84
184 lines (157 loc) · 5.59 KB
/
meson-tests.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#
# Meson Test Suite
#
# This workflow builds the project via meson, configures a suitable test
# environment, and then runs the test-suite defined in meson.
#
# We run the test-suite multiple times in parallel, each run with a different
# setup, ranging from release builds to non-standard configuration flags. We
# do not test the fully expanded matrix, but instead test a pre-defined set
# of setups, to reduce burden on the CI systems.
#
name: "Meson Test Suite"
on:
pull_request:
push:
branches-ignore: ["pr/**"]
tags: ["**"]
workflow_dispatch:
defaults:
run:
shell: "bash"
jobs:
unittest:
name: "Unittest - ${{ matrix.id }} - ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
# Test a release build as recommended by upstream. This picks clang as
# compiler with debug-optimized as build-target. We do not run valgrind
# since it clashes with sd-bus used by the launcher. This test also
# builds documentation and related resources.
- id: "release"
name: "RELEASE @ CLANG-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT +DOCS +LAUNCHER +SELINUX"
# Explicitly set all options here to document them.
buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
m32: "no"
setupargs: "-Daudit=true -Ddocs=true -Dlauncher=true -Dselinux=true"
test: "yes"
valgrind: "no"
warnlevel: "2"
# A release build with `-m32` to test on 32-bit.
- id: "32bit"
name: "RELEASE @ CLANG-I686 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER -SELINUX"
buildtype: "debugoptimized"
cc: "clang"
cflags: "-m32 -Werror"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
m32: "yes"
setupargs: "-Daudit=true -Dlauncher=true"
test: "yes"
warnlevel: "2"
# A release build running through valgrind. We disable all features
# that currently do not support valgrind runs (in particular sd-bus in
# the launcher).
- id: "valgrind"
name: "RELEASE @ CLANG-X86_64 @ +TEST +VALGRIND @ -APPARMOR +AUDIT -DOCS -LAUNCHER -SELINUX"
buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
setupargs: "-Daudit=true -Dlauncher=false"
test: "yes"
valgrind: "yes"
warnlevel: "2"
# A reduced build with `-O0` to verify we do not rely on dead-code
# elimination.
- id: "O0-PLAIN"
name: "PLAIN @ GCC-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER +SELINUX"
buildtype: "plain"
cc: "gcc"
cflags: "-O0 -Werror"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
setupargs: "-Daudit=true -Dlauncher=true -Dselinux=true"
test: "yes"
warnlevel: "2"
# An aggressive -O3 -DNDEBUG build that verfies that we properly
# follow strict aliasing rules and do not rely on debug builds.
- id: "O3-NDEBUG"
name: "OPTIMIZED @ GCC-X86_64 @ +TEST -VALGRIND @ -APPARMOR +AUDIT -DOCS +LAUNCHER +SELINUX"
buildtype: "release"
cc: "gcc"
cflags: "-O3 -Werror -DNDEBUG"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
setupargs: "-Daudit=true -Dlauncher=true -Dselinux=true"
test: "yes"
warnlevel: "2"
# Disable all options to compile-test their fallbacks. Run the test
# suite to run basic fallback verification.
- id: "fallback"
name: "OPTIMIZED @ CLANG-X86_64 @ +TEST -VALGRIND @ -APPARMOR -AUDIT -DOCS -LAUNCHER -SELINUX"
buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
image: "ghcr.io/bus1/dbrk-ci-fedora:latest"
setupargs: "-Dlauncher=false"
test: "yes"
warnlevel: "2"
- id: "ubuntu"
name: "RELEASE @ CLANG-X86_64 @ +TEST -VALGRIND @ +APPARMOR +AUDIT -DOCS +LAUNCHER -SELINUX"
buildtype: "debugoptimized"
cc: "clang"
cflags: "-Werror"
image: "ghcr.io/bus1/dbrk-ci-ubuntu:latest"
setupargs: "-Dapparmor=true -Daudit=true -Dlauncher=true"
test: "yes"
warnlevel: "2"
container:
image: ${{ matrix.image }}
env:
CC: ${{ matrix.cc }}
CFLAGS: ${{ matrix.cflags }}
runs-on: "ubuntu-latest"
steps:
- name: "Fetch Sources"
uses: actions/checkout@v4
- name: "Setup 32-bit Environment"
if: matrix.m32 == 'yes'
run: |
echo \
"PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig" \
>> $GITHUB_ENV
- name: "Setup Meson"
run: |
meson setup \
--buildtype "${{ matrix.buildtype }}" \
--warnlevel "${{ matrix.warnlevel }}" \
${{ matrix.setupargs }} \
"./build" \
"."
- name: "Compile Project"
run: |
meson compile \
-C "./build"
- name: "Run Tests"
if: matrix.test == 'yes'
run: |
meson test \
-C "./build" \
--print-errorlogs
- name: "Run Valgrind"
if: matrix.valgrind == 'yes'
run: |
args=(
"--gen-suppressions=all"
"--trace-children=yes"
"--leak-check=full"
"--error-exitcode=1"
)
meson test \
-C "./build" \
--print-errorlogs \
--timeout-multiplier=16 \
--wrapper="valgrind ${args[*]}"