git subrepo pull (merge) --force deps/libchdr
[pcsx_rearmed.git] / deps / libchdr / deps / zstd-1.5.5 / .github / workflows / dev-short-tests.yml
1 name: dev-short-tests
2 # Faster tests: mostly build tests, along with some other
3 # misc tests
4
5 concurrency:
6   group: fast-${{ github.ref }}
7   cancel-in-progress: true
8
9 on:
10   pull_request:
11     branches: [ dev, release, actionsTest ]
12
13 permissions: read-all
14
15 jobs:
16   linux-kernel:
17     runs-on: ubuntu-latest
18     steps:
19     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
20     - name: linux kernel, library + build + test
21       run: make -C contrib/linux-kernel test CFLAGS="-Werror -Wunused-const-variable -Wunused-but-set-variable"
22
23   benchmarking:
24     runs-on: ubuntu-latest
25     steps:
26     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
27     - name: make benchmarking
28       run: make benchmarking
29
30   check-32bit: # designed to catch https://github.com/facebook/zstd/issues/2428
31     runs-on: ubuntu-latest
32     steps:
33     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
34     - name: make check on 32-bit
35       run: |
36         sudo apt update
37         APT_PACKAGES="gcc-multilib" make apt-install
38         CFLAGS="-m32 -O1 -fstack-protector" make check V=1
39
40   check-x32:
41     runs-on: ubuntu-latest
42     steps:
43     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
44     - name: make check on x32 ABI # https://en.wikipedia.org/wiki/X32_ABI
45       env:
46         CHECK_CONSTRAINED_MEM: true
47       run: |
48         sudo apt update
49         APT_PACKAGES="gcc-multilib" make apt-install
50         CFLAGS="-mx32 -O1 -fstack-protector" make check V=1
51
52   build-c89:
53     runs-on: ubuntu-latest
54     steps:
55     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
56     - name: ensure zstd can be build with c89/c90 compilers (+ long long support + variadic macros)
57       run: |
58         make c89build V=1
59
60   build-zstd-dll:
61     runs-on: ubuntu-latest
62     steps:
63     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
64     - name: build zstd bin against a dynamic lib (debuglevel for more dependencies)
65       run: |
66         make -C lib lib-mt-release 
67         DEBUGLEVEL=2 make -C programs zstd-dll
68
69   gcc-7-libzstd:
70     runs-on: ubuntu-latest
71     steps:
72     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
73     - name: gcc-7 + libzstdmt compilation
74       # See https://askubuntu.com/a/1428822
75       run: |
76         echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" | sudo tee -a /etc/apt/sources.list
77         sudo apt-get -qqq update
78         make gcc7install
79         CC=gcc-7 CFLAGS=-Werror make -j all
80         make clean
81         LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
82
83     # candidate test (to check) : underlink test
84     # LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
85
86   cmake-build-and-test-check:
87     runs-on: ubuntu-latest
88     steps:
89     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
90     - name: cmake build and test check
91       run: |
92         FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
93         cp -r ./ "../zstd source"
94         cd "../zstd source"
95         FUZZERTEST=-T1mn ZSTREAM_TESTTIME=-T1mn make cmakebuild
96
97   cpp-gnu90-c99-compatibility:
98     runs-on: ubuntu-latest
99     steps:
100     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
101     - name: C++, gnu90 and c99 compatibility
102       run: |
103         make cxxtest
104         make clean
105         make gnu90build
106         make clean
107         make c99build
108         make clean
109         make travis-install   # just ensures `make install` works
110
111   mingw-cross-compilation:
112     runs-on: ubuntu-latest
113     steps:
114     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
115     - name: mingw cross-compilation
116       run: |
117         # sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; (doesn't work)
118         sudo apt-get -qqq update
119         sudo apt-get install gcc-mingw-w64
120         CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CFLAGS="-Werror -O1" make zstd
121
122   armbuild:
123     runs-on: ubuntu-latest
124     steps:
125     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
126     - name: ARM Build Test
127       run: |
128         sudo apt-get -qqq update
129         make arminstall
130         make armbuild
131
132   bourne-shell:
133     runs-on: ubuntu-latest
134     steps:
135     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
136     - name: Bourne shell compatibility (shellcheck)
137       run: |
138         wget https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz
139         tar -xf shellcheck-v0.7.1.linux.x86_64.tar.xz
140         shellcheck-v0.7.1/shellcheck --shell=sh --severity=warning --exclude=SC2010 tests/playTests.sh
141
142   zlib-wrapper:
143     runs-on: ubuntu-latest
144     steps:
145     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
146     - name: zlib wrapper test
147       run: |
148         sudo apt-get -qqq update
149         make valgrindinstall
150         make -C zlibWrapper test
151         make -C zlibWrapper test-valgrind
152
153   lz4-threadpool-libs:
154     runs-on: ubuntu-latest
155     steps:
156     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
157     - name: LZ4, thread pool, and libs build testslib wrapper test
158       run: |
159         make lz4install
160         make -C tests test-lz4
161         make check < /dev/null | tee   # mess with lz4 console detection
162         make clean
163         make -C tests test-pool
164         make clean
165         bash tests/libzstd_builds.sh
166
167   gcc-make-tests-32bit:
168     runs-on: ubuntu-latest
169     steps:
170     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
171     - name: Make all, 32bit mode
172       run: |
173         sudo apt-get -qqq update
174         make libc6install
175         CFLAGS="-Werror -m32" make -j all32
176
177   gcc-8-make:
178     runs-on: ubuntu-latest
179     steps:
180       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
181       - name: gcc-8 build
182         # See https://askubuntu.com/a/1428822
183         run: |
184           echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" | sudo tee -a /etc/apt/sources.list
185           sudo apt-get -qqq update
186           make gcc8install
187           CC=gcc-8 CFLAGS="-Werror" make -j all
188
189   make-external-compressors:
190     strategy:
191       matrix:
192         include:
193           - name: "no external compressors"
194             flags: "HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0"
195           - name: "only zlib"
196             flags: "HAVE_ZLIB=1 HAVE_LZ4=0 HAVE_LZMA=0"
197           - name: "only lz4"
198             flags: "HAVE_ZLIB=0 HAVE_LZ4=1 HAVE_LZMA=0"
199           - name: "only lzma"
200             flags: "HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=1"
201     runs-on: ubuntu-latest
202     steps:
203       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
204       - name: Build with ${{matrix.name}}
205         run: ${{matrix.flags}} make zstd
206
207
208   implicit-fall-through:
209     runs-on: ubuntu-latest
210     steps:
211       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
212       - name: -Wimplicit-fallthrough build
213         run: |
214           make clean
215           CC=gcc MOREFLAGS="-Werror -Wimplicit-fallthrough=2 -O0" make -C lib -j libzstd.a ZSTD_LEGACY_SUPPORT=0
216           make clean
217           CC=clang MOREFLAGS="-Werror -Wimplicit-fallthrough -O0" make -C lib -j libzstd.a ZSTD_LEGACY_SUPPORT=0
218
219   meson-linux:
220     runs-on: ubuntu-latest
221     steps:
222       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
223       - name: Install packages
224         run: |
225           sudo apt-get update
226           sudo apt-get -y install build-essential python3-pip ninja-build liblz4-dev
227           pip install --pre meson
228       - name: Build with Meson
229         run: |
230           meson setup \
231             --buildtype=debugoptimized \
232             -Db_lundef=false \
233             -Dauto_features=enabled \
234             -Dbin_programs=true \
235             -Dbin_tests=true \
236             -Dbin_contrib=true \
237             -Ddefault_library=both \
238             build/meson builddir
239           ninja -C builddir/
240           meson test -C builddir/ --print-errorlogs
241           meson install -C builddir --destdir staging/
242
243   meson-windows:
244     runs-on: windows-latest
245     steps:
246       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
247       - name: Install packages
248         run: pip install --pre meson
249       - name: Initialize the MSVC dev command prompt
250         uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
251       - name: Configure with Meson
252         run: |
253           meson setup build/meson/ builddir -Dbin_tests=true -Dbin_programs=true -Dbin_contrib=true
254       - name: Build with Meson
255         run: |
256           ninja -C builddir/
257       - name: Test with Meson
258         run: |
259           meson test -C builddir/ --print-errorlogs
260       - name: Install with Meson
261         run: |
262           meson install -C builddir --destdir staging/
263
264   cmake-visual-2022:
265     strategy:
266       matrix:
267         include:
268           - generator: "Visual Studio 17 2022"
269             flags: "-A x64"
270           - generator: "Visual Studio 17 2022"
271             flags: "-A Win32"
272           - generator: "MinGW Makefiles"
273           - generator: "Visual Studio 17 2022"
274             flags: "-T ClangCL"
275     runs-on: windows-2022
276     steps:
277     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
278     - name: Add MSBuild to PATH
279       uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # tag=v1.3
280     - name: Build
281       working-directory: ${{env.GITHUB_WORKSPACE}}
282       run: |
283         cd build\cmake
284         mkdir build
285         cd build
286         cmake.exe -G "${{matrix.generator}}" ${{matrix.flags}} ..
287         cmake.exe --build .
288
289   msbuild-visual-studio:
290     strategy:
291       fail-fast: false  # 'false' means Don't stop matrix workflows even if some matrix failed.
292       matrix:
293         include: [
294           { name: "VS 2022 x64 Debug", platform: x64, configuration: Debug, toolset: v143, runner: "windows-2022", arch: "" },
295           { name: "VS 2022 Win32 Debug", platform: Win32, configuration: Debug, toolset: v143, runner: "windows-2022", arch: "" },
296           { name: "VS 2022 x64 Release", platform: x64, configuration: Release, toolset: v143, runner: "windows-2022", arch: ""},
297           { name: "VS 2022 Win32 Release", platform: Win32, configuration: Release, toolset: v143, runner: "windows-2022", arch: ""},
298           { name: "VS 2019 x64 Release", platform: Win32, configuration: Release, toolset: v142, runner: "windows-2019", arch: ""},
299           { name: "VS 2019 Win32 Release", platform: x64, configuration: Release, toolset: v142, runner: "windows-2019", arch: ""},
300           { name: "VS 2022 x64 Release AVX2", platform: x64, configuration: Release, toolset: v143, runner: "windows-2022", arch: "AdvancedVectorExtensions2" },
301         ]
302     runs-on: ${{matrix.runner}}
303     steps:
304     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
305     - name: Add MSBuild to PATH
306       uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # tag=v1.3
307     - name: Build ${{matrix.name}}
308       working-directory: ${{env.GITHUB_WORKSPACE}}
309       # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
310       if: ${{ matrix.arch == '' }}
311       run: >
312         msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=${{matrix.toolset}}
313         /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} /warnaserror
314     - name: Build ${{matrix.name}}
315       working-directory: ${{env.GITHUB_WORKSPACE}}
316       # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
317       if: ${{ matrix.arch != '' }}
318       run: >
319         msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=${{matrix.toolset}}
320         /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} /warnaserror
321         /p:InstructionSet=${{matrix.arch}}
322
323   # This tests that we don't accidentally grow the size too much.
324   # If the size grows intentionally, you can raise these numbers.
325   # But we do need to think about binary size, since it is a concern.
326   libzstd-size:
327     runs-on: ubuntu-latest
328     steps:
329     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
330     - name: libzstd size test
331       run: |
332         make clean && make -j -C lib libzstd && ./tests/check_size.py lib/libzstd.so 1100000
333         make clean && make -j -C lib libzstd ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 400000
334         make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 && ./tests/check_size.py lib/libzstd.so 300000
335         make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 80000
336
337   minimal-decompressor-macros:
338     runs-on: ubuntu-latest
339     steps:
340     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
341     - name: minimal decompressor macros
342       run: |
343         make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
344         make clean && make check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
345         make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
346         make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
347         make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
348         make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
349         make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
350         make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
351
352   dynamic-bmi2:
353     runs-on: ubuntu-latest
354     steps:
355     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
356     - name: dynamic bmi2 tests
357       run: |
358         make clean && make -j check MOREFLAGS="-O0 -Werror -mbmi2"
359         make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1"
360         make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1 -mbmi2"
361         make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0"
362         make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0 -mbmi2"
363
364   test-variants:
365     runs-on: ubuntu-latest
366     steps:
367     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
368     - name: make all variants & validate
369       run: |
370         make -j -C programs allVariants MOREFLAGS=-O0
371         ./tests/test-variants.sh
372
373   qemu-consistency:
374     name: QEMU ${{ matrix.name }}
375     runs-on: ubuntu-20.04
376     strategy:
377       fail-fast: false  # 'false' means Don't stop matrix workflows even if some matrix failed.
378       matrix:
379         include: [
380           { name: ARM,      xcc_pkg: gcc-arm-linux-gnueabi,     xcc: arm-linux-gnueabi-gcc,     xemu_pkg: qemu-system-arm,    xemu: qemu-arm-static     },
381           { name: ARM64,    xcc_pkg: gcc-aarch64-linux-gnu,     xcc: aarch64-linux-gnu-gcc,     xemu_pkg: qemu-system-arm,    xemu: qemu-aarch64-static },
382           { name: PPC,      xcc_pkg: gcc-powerpc-linux-gnu,     xcc: powerpc-linux-gnu-gcc,     xemu_pkg: qemu-system-ppc,    xemu: qemu-ppc-static     },
383           { name: PPC64LE,  xcc_pkg: gcc-powerpc64le-linux-gnu, xcc: powerpc64le-linux-gnu-gcc, xemu_pkg: qemu-system-ppc,    xemu: qemu-ppc64le-static },
384           { name: S390X,    xcc_pkg: gcc-s390x-linux-gnu,       xcc: s390x-linux-gnu-gcc,       xemu_pkg: qemu-system-s390x,  xemu: qemu-s390x-static   },
385           { name: MIPS,     xcc_pkg: gcc-mips-linux-gnu,        xcc: mips-linux-gnu-gcc,        xemu_pkg: qemu-system-mips,   xemu: qemu-mips-static    },
386           { name: M68K,     xcc_pkg: gcc-m68k-linux-gnu,        xcc: m68k-linux-gnu-gcc,        xemu_pkg: qemu-system-m68k,   xemu: qemu-m68k-static    },
387         ]
388     env:                        # Set environment variables
389       XCC: ${{ matrix.xcc }}
390       XEMU: ${{ matrix.xemu }}
391     steps:
392     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
393     - name: apt update & install
394       run: |
395         sudo apt-get update
396         sudo apt-get install gcc-multilib g++-multilib qemu-utils qemu-user-static
397         sudo apt-get install ${{ matrix.xcc_pkg }} ${{ matrix.xemu_pkg }}
398     - name: Environment info
399       run: |
400         echo && which $XCC
401         echo && $XCC --version
402         echo && $XCC -v  # Show built-in specs
403         echo && which $XEMU
404         echo && $XEMU --version
405     - name: ARM
406       if: ${{ matrix.name == 'ARM' }}
407       run: |
408         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
409     - name: ARM64
410       if: ${{ matrix.name == 'ARM64' }}
411       run: |
412         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
413     - name: PPC
414       if: ${{ matrix.name == 'PPC' }}
415       run: |
416         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
417     - name: PPC64LE
418       if: ${{ matrix.name == 'PPC64LE' }}
419       run: |
420         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
421     - name: S390X
422       if: ${{ matrix.name == 'S390X' }}
423       run: |
424         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
425     - name: MIPS
426       if: ${{ matrix.name == 'MIPS' }}
427       run: |
428         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
429     - name: M68K
430       if: ${{ matrix.name == 'M68K' }}
431       run: |
432         LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check
433
434   mingw-short-test:
435     runs-on: windows-latest
436     strategy:
437       fail-fast: false  # 'false' means Don't stop matrix workflows even if some matrix failed.
438       matrix:
439         include: [
440           { compiler: gcc, msystem: MINGW32, cflags: "-Werror"},
441           { compiler: gcc, msystem: MINGW64, cflags: "-Werror"},
442           { compiler: clang, msystem: MINGW64, cflags: "--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion -Wno-unused-command-line-argument"},
443         ]
444     defaults:
445       run:
446         shell: msys2 {0}
447     steps:
448     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
449     - uses: msys2/setup-msys2@5beef6d11f48bba68b9eb503e3adc60b23c0cc36 # tag=v2
450       with:
451         msystem: ${{ matrix.msystem }}
452         install: make diffutils
453         update: true
454     # Based on https://ariya.io/2020/07/on-github-actions-with-msys2
455     - name: install mingw gcc i686
456       if: ${{ (matrix.msystem == 'MINGW32') && (matrix.compiler == 'gcc') }}
457       run: pacman --noconfirm -S mingw-w64-i686-gcc
458     - name: install mingw gcc x86_64
459       if: ${{ (matrix.msystem == 'MINGW64') && (matrix.compiler == 'gcc') }}
460       run: pacman --noconfirm -S mingw-w64-x86_64-gcc
461     - name: install mingw clang i686
462       if: ${{ (matrix.msystem == 'MINGW32') && (matrix.compiler == 'clang') }}
463       run: pacman --noconfirm -S mingw-w64-i686-clang
464     - name: install mingw clang x86_64
465       if: ${{ (matrix.msystem == 'MINGW64') && (matrix.compiler == 'clang') }}
466       run: pacman --noconfirm -S mingw-w64-x86_64-clang
467     - name: run mingw tests
468       run: |
469         make -v
470         export CC=${{ matrix.compiler }}
471         $CC --version
472         CFLAGS="${{ matrix.cflags }}" make -j allzstd
473         echo "Testing $CC ${{ matrix.msystem }}"
474         make clean
475         MSYS="" make check
476
477   visual-runtime-tests:
478     runs-on: windows-latest
479     strategy:
480       matrix:
481         platform: [x64, Win32]
482         configuration: [Release]
483     steps:
484     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
485     - name: Add MSBuild to PATH
486       uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # tag=v1.3
487     - name: Build and run tests
488       working-directory: ${{env.GITHUB_WORKSPACE}}
489       env:
490         ZSTD_BIN: ./zstd.exe
491         DATAGEN_BIN: ./datagen.exe
492       # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
493       run: |
494         msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v142 /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}}
495         COPY build\VS2010\bin\${{matrix.platform}}_${{matrix.configuration}}\*.exe tests\
496         CD tests
497         sh -e playTests.sh
498         .\fuzzer.exe -T2m
499
500   # Following instructions at: https://github.com/marketplace/actions/install-cygwin-action
501   cygwin-tests:
502     runs-on: windows-latest
503     steps:
504     - run: git config --global core.autocrlf input
505     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
506     - uses: cygwin/cygwin-install-action@f5e0f048310c425e84bc789f493a828c6dc80a25 # tag=master
507       with:
508         platform: x86_64
509         packages: >-
510           autoconf,
511           automake,
512           gcc-g++,
513           make,
514           mingw64-x86_64-gcc-g++,
515           patch,
516           perl
517     - name: cygwin tests
518       shell: C:\cygwin\bin\bash.exe --noprofile --norc -eo pipefail '{0}'
519       run: >-
520         export PATH=/usr/bin:$(cygpath ${SYSTEMROOT})/system32 &&
521         export CFLAGS="-Werror -O1" &&
522         ls &&
523         make -j allzstd &&
524         make -C tests fuzzer &&
525         ./tests/fuzzer.exe -v -T1m
526
527   intel-cet-compatibility:
528     runs-on: ubuntu-latest
529     steps:
530     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
531     - name: Build Zstd
532       run: |
533         make -j zstd V=1
534         readelf -n zstd
535     - name: Get Intel SDE
536       run: |
537         curl -LO https://downloadmirror.intel.com/684899/sde-external-9.0.0-2021-11-07-lin.tar.xz
538         tar xJvf sde-external-9.0.0-2021-11-07-lin.tar.xz
539     - name: Configure Permissions
540       run: |
541         echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
542     - name: Run Under SDE
543       run: |
544         sde-external-9.0.0-2021-11-07-lin/sde -cet -cet-raise 0 -cet-endbr-exe -cet-stderr -cet-abort -- ./zstd -b3
545
546   pkg-config:
547     runs-on: ubuntu-latest
548     container:
549       image: debian:testing
550     steps:
551       - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
552       - name: Install dependencies
553         run: |
554           apt -y update
555           apt -y install --no-install-recommends gcc libc6-dev make pkg-config
556       - name: Build and install
557         run: make -C lib install
558       - name: Test pkg-config
559         run: |
560           cc -Wall -Wextra -Wpedantic -Werror -o simple examples/simple_compression.c $(pkg-config --cflags --libs libzstd)
561           ./simple LICENSE
562
563   versions-compatibility:
564     runs-on: ubuntu-latest
565     steps:
566     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
567     - name: Versions Compatibility Test
568       run: |
569         make -C tests versionsTest
570
571   clangbuild:
572     runs-on: ubuntu-latest
573     steps:
574     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
575     - name: make clangbuild
576       run: |
577         make clangbuild
578
579   clang-pgo:
580     runs-on: ubuntu-latest
581     steps:
582     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
583     - name: Build PGO Zstd with Clang
584       env:
585         CC: clang-14
586         LLVM_PROFDATA: llvm-profdata-14
587       run: |
588         make -C programs zstd-pgo
589         ./programs/zstd -b
590
591   gcc-pgo:
592     runs-on: ubuntu-latest
593     steps:
594     - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
595     - name: Build PGO Zstd with GCC
596       env:
597         CC: gcc
598       run: |
599         make -C programs zstd-pgo
600         ./programs/zstd -b
601
602
603 # For reference : icc tests
604 # icc tests are currently failing on Github Actions, likely to issues during installation stage
605 # To be fixed later
606 #
607 #  icc:
608 #    name: icc-check
609 #    runs-on: ubuntu-latest
610 #    steps:
611 #    - name: install icc
612 #      run: |
613 #        export DEBIAN_FRONTEND=noninteractive
614 #        sudo apt-get -qqq update
615 #        sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
616 #        sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
617 #        sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
618 #        sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
619 #        sudo apt-get update
620 #        sudo apt-get install -y intel-basekit intel-hpckit
621 #    - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag=v3
622 #    - name: make check
623 #      run: |
624 #        make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check