-
Notifications
You must be signed in to change notification settings - Fork 25
268 lines (256 loc) · 8.31 KB
/
ci.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: CI
on: [pull_request, push]
env:
DEF_CFLAGS: -O2 -g -Wall -Werror
DEPENDENCIES: cmake ninja-build pkgconf libfuse3-dev fuse3 ntfs-3g-dev ntfs-3g
jobs:
gcc-build-and-test:
name: Build and test with gcc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=gcc
-DCMAKE_C_FLAGS="$DEF_CFLAGS"
-DWIMLIB_BUILD_TESTS=1
- run: cmake --build build --verbose
- run: DESTDIR=build/install cmake --install build --verbose
- run: ctest --test-dir build --output-on-failure
clang-build-and-test:
name: Build and test with clang
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang
-DCMAKE_C_FLAGS="$DEF_CFLAGS"
-DWIMLIB_BUILD_TESTS=1
- run: cmake --build build --verbose
- run: DESTDIR=build/install cmake --install build --verbose
- run: ctest --test-dir build --output-on-failure
i386-build-and-test:
name: Build and test with gcc -m32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y gcc-multilib $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=gcc
-DCMAKE_C_FLAGS="$DEF_CFLAGS -m32"
-DWIMLIB_FUSE_SUPPORT=0 -DWIMLIB_NTFS_3G_SUPPORT=0
-DWIMLIB_BUILD_TESTS=1
- run: cmake --build build --verbose
- run: DESTDIR=build/install cmake --install build --verbose
- run: ctest --test-dir build --output-on-failure
asan-build-and-test:
name: Build and test with ASAN enabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang
-DCMAKE_C_FLAGS="$DEF_CFLAGS -fsanitize=address -fno-sanitize-recover=address"
-DWIMLIB_BUILD_TESTS=1
- run: cmake --build build --verbose
- run: ctest --test-dir build --output-on-failure
ubsan-build-and-test:
name: Build and test with UBSAN enabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang
-DCMAKE_C_FLAGS="$DEF_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
-DWIMLIB_BUILD_TESTS=1
- run: ctest --test-dir build --output-on-failure
run-shellcheck:
name: Run shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run shellcheck
run: shellcheck tools/*.sh tools/*/*.sh
macos-build-and-test:
name: Build and test on macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install cmake ninja pkg-config
- run: >
cmake -B build -G Ninja
-DCMAKE_C_FLAGS="$DEF_CFLAGS" -DWIMLIB_NTFS_3G_SUPPORT=0
-DWIMLIB_BUILD_TESTS=1
- run: cmake --build build --verbose
- run: DESTDIR=build/install cmake --install build --verbose
- run: ctest --test-dir build --output-on-failure
windows-build:
name: Build on Windows
runs-on: windows-latest
strategy:
matrix:
include:
- { msystem: MINGW32, packages: mingw-w64-i686-gcc
mingw-w64-i686-cmake
mingw-w64-i686-ninja }
- { msystem: MINGW64, packages: mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja }
- { msystem: CLANG32, packages: mingw-w64-clang-i686-clang
mingw-w64-clang-i686-cmake
mingw-w64-clang-i686-ninja }
- { msystem: CLANG64, packages: mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-ninja }
- { msystem: CLANGARM64, options: --install-prerequisites }
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Need tags for tools/get-version-number.sh
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.msystem}}
update: true
install: >
git
pkgconf
${{matrix.packages}}
- run: CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh ${{matrix.options}}
- uses: actions/upload-artifact@v4
with:
name: windows-${{matrix.msystem}}-bin
path: wimlib-*-bin
win32-test-imagex-capture-and-apply:
name: Run win32-test-imagex-capture_and_apply.bat
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Need tags for tools/get-version-number.sh
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >
git
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja
pkgconf
- run: tests/win32-test-imagex-capture_and_apply.sh
fuzz-with-libFuzzer:
name: Fuzz with libFuzzer (${{matrix.target}} ${{matrix.sanitizer}})
strategy:
matrix:
include:
- target: wim
sanitizer:
- target: wim
sanitizer: --asan --ubsan
- target: encoding
sanitizer: --asan --ubsan
- target: xmlproc
sanitizer:
- target: xmlproc
sanitizer: --asan --ubsan
- target: xml_windows
sanitizer: --asan --ubsan
- target: compress
sanitizer:
- target: compress
sanitizer: --asan --ubsan
- target: decompress
sanitizer:
- target: decompress
sanitizer: --asan --ubsan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang $DEPENDENCIES
- name: Fuzz
run: |
tools/libFuzzer/fuzz.sh --time=120 ${{matrix.sanitizer}} \
${{matrix.target}}
fuzz-with-wlfuzz-linux:
name: Fuzz with wlfuzz (Linux, ${{matrix.sanitizer}})
strategy:
matrix:
include:
- sanitizer: none
cflags:
- sanitizer: ASAN
cflags: -fsanitize=address -fno-sanitize-recover=address
- sanitizer: UBSAN
cflags: -fsanitize=undefined -fno-sanitize-recover=undefined
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang $DEPENDENCIES
- run: >
cmake -B build -G Ninja -DCMAKE_C_COMPILER=clang
-DCMAKE_C_FLAGS="$DEF_CFLAGS ${{matrix.cflags}}"
-DWIMLIB_BUILD_TESTS=1
-DWIMLIB_FUZZ_TEST_SUPPORT=1
- run: cmake --build build --verbose
- run: TMPDIR=$PWD/tmp.wlfuzz build/tests/wlfuzz 120
fuzz-with-wlfuzz-windows:
name: Fuzz with wlfuzz (Windows)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Need tags for tools/get-version-number.sh
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >
git
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-ninja
pkgconf
- run: >
CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh --
-DWIMLIB_FUZZ_TEST_SUPPORT=1 -DWIMLIB_BUILD_TESTS=1
- run: TMPDIR=$PWD/tmp.wlfuzz build/tests/wlfuzz 120