-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (167 loc) · 5.49 KB
/
Copy pathci.yml
File metadata and controls
202 lines (167 loc) · 5.49 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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
jobs:
ubuntu-build:
name: Ubuntu build and tests
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Install dependencies
run: |
# Drop pre-installed third-party repos (Microsoft/azure) that
# intermittently 403 and break apt-get update; we only need Ubuntu's.
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list \
/etc/apt/sources.list.d/azure-cli.list \
/etc/apt/sources.list.d/microsoft*.list || true
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
ccache \
cmake \
ninja-build \
libx11-dev \
libssl-dev \
pkg-config \
zlib1g-dev
- name: Configure
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Compiler cache stats
run: ccache --show-stats
fedora-build:
name: Fedora build and tests
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install dependencies
run: |
dnf install -y --setopt=install_weak_deps=False \
ccache \
cmake \
gcc-c++ \
git \
gtk3-devel \
libayatana-appindicator3-devel \
libX11-devel \
make \
ninja-build \
openssl-devel \
pkgconf-pkg-config \
rpm-build \
systemd-rpm-macros \
zlib-devel
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Validate RPM packaging, build, and tests
run: |
MWB_VALIDATE_RPM_BUILD=1 \
MWB_RPM_CMAKE_EXTRA_ARGS="-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" \
scripts/validate-rpm-packaging.sh
- name: Compiler cache stats
run: ccache --show-stats
sanitizers:
name: ASan and UBSan
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ github.job }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-ccache-
- name: Install dependencies
run: |
# Drop pre-installed third-party repos (Microsoft/azure) that
# intermittently 403 and break apt-get update; we only need Ubuntu's.
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list \
/etc/apt/sources.list.d/azure-cli.list \
/etc/apt/sources.list.d/microsoft*.list || true
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
ccache \
cmake \
ninja-build \
libx11-dev \
libssl-dev \
pkg-config \
zlib1g-dev
- name: Configure
run: cmake -S . -B build-sanitize -G Ninja -DCMAKE_BUILD_TYPE=Debug -DMWB_ENABLE_SANITIZERS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build-sanitize --parallel
- name: Test
run: ctest --test-dir build-sanitize --output-on-failure
- name: Compiler cache stats
run: ccache --show-stats
static-checks:
name: Static checks
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Check trailing whitespace
run: |
if git grep -nI '[[:blank:]]$' -- .; then
echo "Trailing whitespace found"
exit 1
fi
- name: Check shell syntax
run: |
bash -n mwb-desktop-ui.sh
bash -n scripts/inputflow-diagnostics-bundle.sh
bash -n scripts/validate-rpm-packaging.sh
- name: Validate RPM packaging skeleton
run: scripts/validate-rpm-packaging.sh
android-build:
name: Android build and unit tests
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Build debug APK and run unit tests
working-directory: android
run: |
./gradlew :app:assembleDebug :app:testDebugUnitTest --no-daemon --stacktrace