2 on: [pull_request, push]
4 DEF_CFLAGS: -O2 -g -Wall -Werror
5 DEPENDENCIES: autoconf automake libtool pkgconf libfuse3-dev fuse3 ntfs-3g-dev ntfs-3g
9 name: Build and test with gcc
10 runs-on: ubuntu-latest
12 - uses: actions/checkout@v3
13 - name: Install dependencies
16 sudo apt-get install -y $DEPENDENCIES
18 - run: ./configure CC=gcc CFLAGS="$DEF_CFLAGS"
19 - run: make -j8 check V=1
20 - run: make -j8 install V=1 DESTDIR=$PWD/installdir
21 - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir
22 - uses: actions/upload-artifact@v3
29 name: Build and test with clang
30 runs-on: ubuntu-latest
32 - uses: actions/checkout@v3
33 - name: Install dependencies
36 sudo apt-get install -y clang $DEPENDENCIES
38 - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS"
39 - run: make -j8 check V=1
40 - run: make -j8 install V=1 DESTDIR=$PWD/installdir
41 - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir
42 - uses: actions/upload-artifact@v3
49 name: Build and test with gcc -m32
50 runs-on: ubuntu-latest
52 - uses: actions/checkout@v3
53 - name: Install dependencies
55 sudo dpkg --add-architecture i386
57 sudo apt-get install -y gcc-multilib $DEPENDENCIES
59 - run: ./configure CC=gcc CFLAGS="-m32 $DEF_CFLAGS" --without-fuse --without-ntfs-3g
60 - run: make -j8 check V=1
61 - run: make -j8 install V=1 DESTDIR=$PWD/installdir
62 - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir
63 - uses: actions/upload-artifact@v3
70 name: Build and test with ASAN enabled
71 runs-on: ubuntu-latest
73 - uses: actions/checkout@v3
74 - name: Install dependencies
77 sudo apt-get install -y clang $DEPENDENCIES
79 - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=address -fno-sanitize-recover=address"
80 - run: make -j8 check V=1
81 - uses: actions/upload-artifact@v3
88 name: Build and test with UBSAN enabled
89 runs-on: ubuntu-latest
91 - uses: actions/checkout@v3
92 - name: Install dependencies
95 sudo apt-get install -y clang $DEPENDENCIES
97 - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined"
98 - run: make -j8 check V=1
99 - uses: actions/upload-artifact@v3
102 name: ubsan-test-logs
107 runs-on: ubuntu-latest
109 - uses: actions/checkout@v3
110 - name: Install dependencies
113 sudo apt-get install -y shellcheck
114 - name: Run shellcheck
115 run: shellcheck tools/*.sh tools/*/*.sh
117 macos-build-and-test:
118 name: Build and test on macOS
119 runs-on: macos-latest
121 - uses: actions/checkout@v3
122 - name: Install dependencies
124 brew install autoconf automake libtool pkg-config
126 - run: ./configure CFLAGS="$DEF_CFLAGS" --without-fuse --without-ntfs-3g
127 - run: make -j8 check V=1
128 - run: make -j8 install DESTDIR=$PWD/installdir
129 - run: make -j8 uninstall DESTDIR=$PWD/installdir
130 - uses: actions/upload-artifact@v3
133 name: macos-test-logs
137 name: Build on Windows
138 runs-on: windows-latest
142 - { msystem: MINGW32, cc_pkg: mingw-w64-i686-gcc }
143 - { msystem: MINGW64, cc_pkg: mingw-w64-x86_64-gcc }
144 - { msystem: CLANG32, cc_pkg: mingw-w64-clang-i686-clang }
145 - { msystem: CLANG64, cc_pkg: mingw-w64-clang-x86_64-clang }
146 - { msystem: CLANGARM64, options: --install-prerequisites }
151 - uses: actions/checkout@v3
153 fetch-depth: 0 # Need tags for tools/get-version-number.sh
154 - uses: msys2/setup-msys2@v2
156 msystem: ${{matrix.msystem}}
166 - run: CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh ${{matrix.options}}
167 - uses: actions/upload-artifact@v3
169 name: windows-${{matrix.msystem}}-bin
172 win32-test-imagex-capture-and-apply:
173 name: Run win32-test-imagex-capture_and_apply.bat
174 runs-on: windows-latest
179 - uses: actions/checkout@v3
181 fetch-depth: 0 # Need tags for tools/get-version-number.sh
182 - uses: msys2/setup-msys2@v2
194 - run: tests/win32-test-imagex-capture_and_apply.sh
197 name: Fuzz with libFuzzer (${{matrix.target}} ${{matrix.sanitizer}})
204 sanitizer: --asan --ubsan
206 sanitizer: --asan --ubsan
210 sanitizer: --asan --ubsan
211 - target: xml_windows
212 sanitizer: --asan --ubsan
216 sanitizer: --asan --ubsan
220 sanitizer: --asan --ubsan
221 runs-on: ubuntu-latest
223 - uses: actions/checkout@v3
224 - name: Install dependencies
227 sudo apt-get install -y clang $DEPENDENCIES
231 tools/libFuzzer/fuzz.sh --time=120 ${{matrix.sanitizer}} \
234 fuzz-with-wlfuzz-linux:
235 name: Fuzz with wlfuzz (Linux, ${{matrix.sanitizer}})
242 cflags: -fsanitize=address -fno-sanitize-recover=address
244 cflags: -fsanitize=undefined -fno-sanitize-recover=undefined
245 runs-on: ubuntu-latest
247 - uses: actions/checkout@v3
248 - name: Install dependencies
251 sudo apt-get install -y clang $DEPENDENCIES
253 - run: ./configure --enable-test-support CC=clang CFLAGS="$DEF_CFLAGS ${{matrix.cflags}}"
254 - run: make -j8 tests/wlfuzz
255 - run: TMPDIR=$PWD/tmp.wlfuzz tests/wlfuzz 120
257 fuzz-with-wlfuzz-windows:
258 name: Fuzz with wlfuzz (Windows)
259 runs-on: windows-latest
264 - uses: actions/checkout@v3
266 fetch-depth: 0 # Need tags for tools/get-version-number.sh
267 - uses: msys2/setup-msys2@v2
279 - run: CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh -- --enable-test-support
280 - run: make tests/wlfuzz.exe
281 - run: TMPDIR=$PWD/tmp.wlfuzz tests/wlfuzz 120