diff --git a/.github/workflows/dev-long-tests.yml b/.github/workflows/dev-long-tests.yml index f75f61f8e39..d932e76318e 100644 --- a/.github/workflows/dev-long-tests.yml +++ b/.github/workflows/dev-long-tests.yml @@ -1,286 +1,286 @@ -name: dev-long-tests -# Tests longer than 10mn +# name: dev-long-tests +# # Tests longer than 10mn -concurrency: - group: long-${{ github.ref }} - cancel-in-progress: true +# concurrency: +# group: long-${{ github.ref }} +# cancel-in-progress: true -on: - pull_request: - branches: [ dev, release, actionsTest ] +# on: +# pull_request: +# branches: [ dev, release, actionsTest ] -jobs: - make-all: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: make all - run: make all +# jobs: +# make-all: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: make all +# run: make all - # lasts ~24mn - make-test: - runs-on: ubuntu-latest - env: - DEVNULLRIGHTS: 1 - READFROMBLOCKDEVICE: 1 - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: make test - run: make test +# # lasts ~24mn +# make-test: +# runs-on: ubuntu-latest +# env: +# DEVNULLRIGHTS: 1 +# READFROMBLOCKDEVICE: 1 +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: make test +# run: make test - # lasts ~26mn - make-test-osx: - runs-on: macos-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: OS-X test - run: make test # make -c lib all doesn't work because of the fact that it's not a tty +# # lasts ~26mn +# make-test-osx: +# runs-on: macos-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: OS-X test +# run: make test # make -c lib all doesn't work because of the fact that it's not a tty - no-intrinsics-fuzztest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: no intrinsics fuzztest - run: MOREFLAGS="-DZSTD_NO_INTRINSICS" make -C tests fuzztest +# no-intrinsics-fuzztest: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: no intrinsics fuzztest +# run: MOREFLAGS="-DZSTD_NO_INTRINSICS" make -C tests fuzztest - tsan-zstreamtest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: thread sanitizer zstreamtest - run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream +# tsan-zstreamtest: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: thread sanitizer zstreamtest +# run: CC=clang ZSTREAM_TESTTIME=-T3mn make tsan-test-zstream - ubsan-zstreamtest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: undefined behavior sanitizer zstreamtest - run: CC=clang make uasan-test-zstream +# ubsan-zstreamtest: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: undefined behavior sanitizer zstreamtest +# run: CC=clang make uasan-test-zstream - # lasts ~15mn - tsan-fuzztest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: thread sanitizer fuzztest - run: CC=clang make tsan-fuzztest +# # lasts ~15mn +# tsan-fuzztest: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: thread sanitizer fuzztest +# run: CC=clang make tsan-fuzztest - # lasts ~23mn - gcc-8-asan-ubsan-testzstd: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: gcc-8 + ASan + UBSan + Test Zstd - # See https://askubuntu.com/a/1428822 - run: | - echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe" | sudo tee -a /etc/apt/sources.list - sudo apt-get -qqq update - make gcc8install - CC=gcc-8 make -j uasan-test-zstd +# msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v142 +# /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} + +# # TODO: fix as part of https://github.com/facebook/zstd/issues/3064 +# # visual-2015: +# # # only GH actions windows-2016 contains VS 2015 +# # runs-on: windows-2016 +# # strategy: +# # matrix: +# # platform: [x64, Win32] +# # configuration: [Debug, Release] +# # steps: +# # - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# # - name: Add MSBuild to PATH +# # uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 +# # - name: Build +# # working-directory: ${{env.GITHUB_WORKSPACE}} +# # run: > +# # msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 +# # /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} + +# # This tests that we don't accidently grow the size too much. +# # If the size grows intentionally, you can raise these numbers. +# # But we do need to think about binary size, since it is a concern. +# libzstd-size: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: libzstd size test +# run: | +# make clean && make -j -C lib libzstd && ./tests/check_size.py lib/libzstd.so 1100000 +# make clean && make -j -C lib libzstd ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 400000 +# make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 && ./tests/check_size.py lib/libzstd.so 300000 +# 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 + +# minimal-decompressor-macros: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: minimal decompressor macros +# run: | +# make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror" +# make clean && make check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror" +# make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT" +# make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT" +# make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG" +# make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG" +# make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" +# make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" + +# dynamic-bmi2: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: dynamic bmi2 tests +# run: | +# make clean && make -j check MOREFLAGS="-O0 -Werror -mbmi2" +# make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1" +# make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1 -mbmi2" +# make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0" +# make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0 -mbmi2" + +# test-variants: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: make all variants & validate +# run: | +# make -j -C programs allVariants MOREFLAGS=-O0 +# ./tests/test-variants.sh + + +# qemu-consistency: +# name: QEMU ${{ matrix.name }} +# runs-on: ubuntu-20.04 +# strategy: +# fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix failed. +# matrix: +# include: [ +# { name: ARM, xcc_pkg: gcc-arm-linux-gnueabi, xcc: arm-linux-gnueabi-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-arm-static }, +# { name: ARM64, xcc_pkg: gcc-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static }, +# { name: PPC, xcc_pkg: gcc-powerpc-linux-gnu, xcc: powerpc-linux-gnu-gcc, xemu_pkg: qemu-system-ppc, xemu: qemu-ppc-static }, +# { name: PPC64LE, xcc_pkg: gcc-powerpc64le-linux-gnu, xcc: powerpc64le-linux-gnu-gcc, xemu_pkg: qemu-system-ppc, xemu: qemu-ppc64le-static }, +# { name: S390X, xcc_pkg: gcc-s390x-linux-gnu, xcc: s390x-linux-gnu-gcc, xemu_pkg: qemu-system-s390x, xemu: qemu-s390x-static }, +# { name: MIPS, xcc_pkg: gcc-mips-linux-gnu, xcc: mips-linux-gnu-gcc, xemu_pkg: qemu-system-mips, xemu: qemu-mips-static }, +# { name: M68K, xcc_pkg: gcc-m68k-linux-gnu, xcc: m68k-linux-gnu-gcc, xemu_pkg: qemu-system-m68k, xemu: qemu-m68k-static }, +# ] +# env: # Set environment variables +# XCC: ${{ matrix.xcc }} +# XEMU: ${{ matrix.xemu }} +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: apt update & install +# run: | +# sudo apt-get update +# sudo apt-get install gcc-multilib g++-multilib qemu-utils qemu-user-static +# sudo apt-get install ${{ matrix.xcc_pkg }} ${{ matrix.xemu_pkg }} +# - name: Environment info +# run: | +# echo && which $XCC +# echo && $XCC --version +# echo && $XCC -v # Show built-in specs +# echo && which $XEMU +# echo && $XEMU --version +# - name: ARM +# if: ${{ matrix.name == 'ARM' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: ARM64 +# if: ${{ matrix.name == 'ARM64' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: PPC +# if: ${{ matrix.name == 'PPC' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: PPC64LE +# if: ${{ matrix.name == 'PPC64LE' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: S390X +# if: ${{ matrix.name == 'S390X' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: MIPS +# if: ${{ matrix.name == 'MIPS' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check +# - name: M68K +# if: ${{ matrix.name == 'M68K' }} +# run: | +# LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check + + # mingw-short-test: + # runs-on: windows-latest + # strategy: + # fail-fast: false + # matrix: + # include: [ + # { compiler: gcc, platform: x64, script: "CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2"}, + # { compiler: gcc, platform: x86, script: "CFLAGS=-Werror make -j allzstd"}, + # { compiler: clang, platform: x64, script: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"}, + # ] + # steps: + # - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 + # - name: Mingw short test + # run: | + # ECHO "Building ${{matrix.compiler}} ${{matrix.platform}}" + # $PSNativeCommandUseErrorActionPreference = $true + # $ErrorActionPreference = 'Stop' + # $env:PATH_ORIGINAL = $env:PATH + # $env:PATH_MINGW32 = "C:\msys64\mingw32\bin" + # $env:PATH_MINGW64 = "C:\msys64\mingw64\bin" + # $env:PATH = "C:\msys64\usr\bin;$env:PATH" + # where pacman + # C:\msys64\usr\bin\pacman '--noconfirm' '-S' '--needed' '--overwrite' 'make' + # COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw32\bin\make.exe + # COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw64\bin\make.exe + # IF ("${{matrix.platform}}" -eq "x64") + # { + # $env:PATH = $env:PATH_MINGW64 + ";" + $env:PATH_ORIGINAL + # } + # ELSEIF ("${{matrix.platform}}" -eq "x86") + # { + # $env:PATH = $env:PATH_MINGW32 + ";" + $env:PATH_ORIGINAL + # } + # make -v + # sh -c "${{matrix.compiler}} -v" + # $env:CC = "${{matrix.compiler}}" + # sh -c "${{matrix.script}}" + # ECHO "Testing ${{matrix.compiler}} ${{matrix.platform}}" + # make clean + # make check + + windows: runs-on: windows-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Install packages - run: pip install --pre meson - - name: Initialize the MSVC dev command prompt - uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d - - name: Configure with Meson - run: | - meson setup build/meson/ builddir -Dbin_tests=true -Dbin_programs=true -Dbin_contrib=true - - name: Build with Meson - run: | - ninja -C builddir/ - - name: Test with Meson - run: | - meson test -C builddir/ --print-errorlogs - - name: Install with Meson - run: | - meson install -C builddir --destdir staging/ - - cmake-visual-2019: - runs-on: windows-2019 strategy: - matrix: - include: - - generator: "Visual Studio 16 2019" - flags: "-A x64" - - generator: "Visual Studio 16 2019" - flags: "-A Win32" - - generator: "MinGW Makefiles" - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 - - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - run: | - cd build\cmake - mkdir build - cd build - cmake.exe -G "${{matrix.generator}}" ${{matrix.flags}} .. - cmake.exe --build . - - visual-2019: - runs-on: windows-2019 - strategy: - matrix: - platform: [x64, Win32] - configuration: [Debug, Release] - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 - - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: > - msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v142 - /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} - -# TODO: fix as part of https://github.com/facebook/zstd/issues/3064 -# visual-2015: -# # only GH actions windows-2016 contains VS 2015 -# runs-on: windows-2016 -# strategy: -# matrix: -# platform: [x64, Win32] -# configuration: [Debug, Release] -# steps: -# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 -# - name: Add MSBuild to PATH -# uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 -# - name: Build -# working-directory: ${{env.GITHUB_WORKSPACE}} -# run: > -# msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 -# /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} - - # This tests that we don't accidently grow the size too much. - # If the size grows intentionally, you can raise these numbers. - # But we do need to think about binary size, since it is a concern. - libzstd-size: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: libzstd size test - run: | - make clean && make -j -C lib libzstd && ./tests/check_size.py lib/libzstd.so 1100000 - make clean && make -j -C lib libzstd ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 && ./tests/check_size.py lib/libzstd.so 400000 - make clean && make -j -C lib libzstd ZSTD_LIB_MINIFY=1 && ./tests/check_size.py lib/libzstd.so 300000 - 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 - - minimal-decompressor-macros: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: minimal decompressor macros - run: | - make clean && make -j all ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror" - make clean && make check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror" - make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT" - make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT" - make clean && make -j all MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG" - make clean && make check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG" - make clean && make -j all MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" - make clean && make check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS" - - dynamic-bmi2: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: dynamic bmi2 tests - run: | - make clean && make -j check MOREFLAGS="-O0 -Werror -mbmi2" - make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1" - make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=1 -mbmi2" - make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0" - make clean && make -j check MOREFLAGS="-O0 -Werror -DDYNAMIC_BMI2=0 -mbmi2" - - test-variants: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: make all variants & validate - run: | - make -j -C programs allVariants MOREFLAGS=-O0 - ./tests/test-variants.sh - - - qemu-consistency: - name: QEMU ${{ matrix.name }} - runs-on: ubuntu-20.04 - strategy: - fail-fast: false # 'false' means Don't stop matrix workflows even if some matrix failed. matrix: include: [ - { name: ARM, xcc_pkg: gcc-arm-linux-gnueabi, xcc: arm-linux-gnueabi-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-arm-static }, - { name: ARM64, xcc_pkg: gcc-aarch64-linux-gnu, xcc: aarch64-linux-gnu-gcc, xemu_pkg: qemu-system-arm, xemu: qemu-aarch64-static }, - { name: PPC, xcc_pkg: gcc-powerpc-linux-gnu, xcc: powerpc-linux-gnu-gcc, xemu_pkg: qemu-system-ppc, xemu: qemu-ppc-static }, - { name: PPC64LE, xcc_pkg: gcc-powerpc64le-linux-gnu, xcc: powerpc64le-linux-gnu-gcc, xemu_pkg: qemu-system-ppc, xemu: qemu-ppc64le-static }, - { name: S390X, xcc_pkg: gcc-s390x-linux-gnu, xcc: s390x-linux-gnu-gcc, xemu_pkg: qemu-system-s390x, xemu: qemu-s390x-static }, - { name: MIPS, xcc_pkg: gcc-mips-linux-gnu, xcc: mips-linux-gnu-gcc, xemu_pkg: qemu-system-mips, xemu: qemu-mips-static }, - { name: M68K, xcc_pkg: gcc-m68k-linux-gnu, xcc: m68k-linux-gnu-gcc, xemu_pkg: qemu-system-m68k, xemu: qemu-m68k-static }, + { compiler: gcc, msystem: MINGW32, cflags: "-Werror"}, + { compiler: gcc, msystem: MINGW64, cflags: "-Werror"}, + { compiler: clang, msystem: MINGW64, cflags: "--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion"}, ] - env: # Set environment variables - XCC: ${{ matrix.xcc }} - XEMU: ${{ matrix.xemu }} + defaults: + run: + shell: msys2 {0} steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: apt update & install - run: | - sudo apt-get update - sudo apt-get install gcc-multilib g++-multilib qemu-utils qemu-user-static - sudo apt-get install ${{ matrix.xcc_pkg }} ${{ matrix.xemu_pkg }} - - name: Environment info - run: | - echo && which $XCC - echo && $XCC --version - echo && $XCC -v # Show built-in specs - echo && which $XEMU - echo && $XEMU --version - - name: ARM - if: ${{ matrix.name == 'ARM' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: ARM64 - if: ${{ matrix.name == 'ARM64' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: PPC - if: ${{ matrix.name == 'PPC' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: PPC64LE - if: ${{ matrix.name == 'PPC64LE' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: S390X - if: ${{ matrix.name == 'S390X' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: MIPS - if: ${{ matrix.name == 'MIPS' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - name: M68K - if: ${{ matrix.name == 'M68K' }} - run: | - LDFLAGS="-static" CC=$XCC QEMU_SYS=$XEMU make clean check - - mingw-short-test: - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - include: [ - { compiler: gcc, platform: x64, script: "CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2"}, - { compiler: gcc, platform: x86, script: "CFLAGS=-Werror make -j allzstd"}, - { compiler: clang, platform: x64, script: "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd V=1"}, - ] - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Mingw short test - run: | - ECHO "Building ${{matrix.compiler}} ${{matrix.platform}}" - $env:PATH_ORIGINAL = $env:PATH - $env:PATH_MINGW32 = "C:\msys64\mingw32\bin" - $env:PATH_MINGW64 = "C:\msys64\mingw64\bin" - COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw32\bin\make.exe - COPY C:\msys64\usr\bin\make.exe C:\msys64\mingw64\bin\make.exe - IF ("${{matrix.platform}}" -eq "x64") - { - $env:PATH = $env:PATH_MINGW64 + ";" + $env:PATH_ORIGINAL - } - ELSEIF ("${{matrix.platform}}" -eq "x86") - { - $env:PATH = $env:PATH_MINGW32 + ";" + $env:PATH_ORIGINAL - } - make -v - sh -c "${{matrix.compiler}} -v" - $env:CC = "${{matrix.compiler}}" - sh -c "${{matrix.script}}" - ECHO "Testing ${{matrix.compiler}} ${{matrix.platform}}" + - uses: actions/checkout@v2 + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + install: make diffutils + update: true + # Based on https://ariya.io/2020/07/on-github-actions-with-msys2 + - name: install mingw gcc + run: pacman --noconfirm -S gcc + if: ${{ matrix.compiler == 'gcc' }} + - name: install mingw clang x86_64 + run: pacman --noconfirm -S mingw-w64-x86_64-clang + if: ${{ (matrix.msystem == 'MINGW64') && (matrix.compiler == 'clang') }} + - name: install mingw clang i686 + run: pacman --noconfirm -S mingw-w64-i686-clang + if: ${{ (matrix.msystem == 'MINGW32') && (matrix.compiler == 'clang') }} + - name: run mingw tests + run: | + export CC=${{ matrix.compiler }} + $CC --version + CFLAGS="${{ matrix.cflags }}" make -j allzstd + echo "Testing $CC ${{ matrix.msystem }}" make clean make check - - visual-runtime-tests: - runs-on: windows-2019 - strategy: - matrix: - platform: [x64, Win32] - configuration: [Release] - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 - - name: Build and run tests - working-directory: ${{env.GITHUB_WORKSPACE}} - env: - ZSTD_BIN: ./zstd.exe - DATAGEN_BIN: ./datagen.exe - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: | - msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v142 /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} - COPY build\VS2010\bin\${{matrix.platform}}_${{matrix.configuration}}\*.exe tests\ - CD tests - sh -e playTests.sh - DIR - .\fuzzer.exe -T2m - - intel-cet-compatibility: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Build Zstd - run: | - make -j zstd V=1 - readelf -n zstd - - name: Get Intel SDE - run: | - curl -LO https://downloadmirror.intel.com/684899/sde-external-9.0.0-2021-11-07-lin.tar.xz - tar xJvf sde-external-9.0.0-2021-11-07-lin.tar.xz - - name: Configure Permissions - run: | - echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope - - name: Run Under SDE - run: | - sde-external-9.0.0-2021-11-07-lin/sde -cet -cet-raise 0 -cet-endbr-exe -cet-stderr -cet-abort -- ./zstd -b3 - - pkg-config: - runs-on: ubuntu-latest - container: - image: debian:testing - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Install dependencies - run: | - apt -y update - apt -y install --no-install-recommends gcc libc6-dev make pkg-config - - name: Build and install - run: make -C lib install - - name: Test pkg-config - run: | - cc -Wall -Wextra -Wpedantic -Werror -o simple examples/simple_compression.c $(pkg-config --cflags --libs libzstd) - ./simple LICENSE - - versions-compatibility: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: Versions Compatibility Test - run: | - make -C tests versionsTest - - clangbuild: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 - - name: make clangbuild - run: | - make clangbuild - - -# For reference : icc tests -# icc tests are currently failing on Github Actions, likely to issues during installation stage -# To be fixed later -# -# icc: -# name: icc-check -# runs-on: ubuntu-latest -# steps: -# - name: install icc -# run: | -# export DEBIAN_FRONTEND=noninteractive -# sudo apt-get -qqq update -# sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg -# sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -# sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" -# sudo apt-get update -# sudo apt-get install -y intel-basekit intel-hpckit -# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 -# - name: make check -# run: | -# make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check +# visual-runtime-tests: +# runs-on: windows-2019 +# strategy: +# matrix: +# platform: [x64, Win32] +# configuration: [Release] +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: Add MSBuild to PATH +# uses: microsoft/setup-msbuild@34cfbaee7f672c76950673338facd8a73f637506 # tag=v1.1.3 +# - name: Build and run tests +# working-directory: ${{env.GITHUB_WORKSPACE}} +# env: +# ZSTD_BIN: ./zstd.exe +# DATAGEN_BIN: ./datagen.exe +# # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference +# run: | +# msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v142 /t:Clean,Build /p:Platform=${{matrix.platform}} /p:Configuration=${{matrix.configuration}} +# COPY build\VS2010\bin\${{matrix.platform}}_${{matrix.configuration}}\*.exe tests\ +# CD tests +# sh -e playTests.sh +# DIR +# .\fuzzer.exe -T2m + +# intel-cet-compatibility: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: Build Zstd +# run: | +# make -j zstd V=1 +# readelf -n zstd +# - name: Get Intel SDE +# run: | +# curl -LO https://downloadmirror.intel.com/684899/sde-external-9.0.0-2021-11-07-lin.tar.xz +# tar xJvf sde-external-9.0.0-2021-11-07-lin.tar.xz +# - name: Configure Permissions +# run: | +# echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope +# - name: Run Under SDE +# run: | +# sde-external-9.0.0-2021-11-07-lin/sde -cet -cet-raise 0 -cet-endbr-exe -cet-stderr -cet-abort -- ./zstd -b3 + +# pkg-config: +# runs-on: ubuntu-latest +# container: +# image: debian:testing +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: Install dependencies +# run: | +# apt -y update +# apt -y install --no-install-recommends gcc libc6-dev make pkg-config +# - name: Build and install +# run: make -C lib install +# - name: Test pkg-config +# run: | +# cc -Wall -Wextra -Wpedantic -Werror -o simple examples/simple_compression.c $(pkg-config --cflags --libs libzstd) +# ./simple LICENSE + +# versions-compatibility: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: Versions Compatibility Test +# run: | +# make -C tests versionsTest + +# clangbuild: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# - name: make clangbuild +# run: | +# make clangbuild + + +# # For reference : icc tests +# # icc tests are currently failing on Github Actions, likely to issues during installation stage +# # To be fixed later +# # +# # icc: +# # name: icc-check +# # runs-on: ubuntu-latest +# # steps: +# # - name: install icc +# # run: | +# # export DEBIAN_FRONTEND=noninteractive +# # sudo apt-get -qqq update +# # sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg +# # sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB +# # sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB +# # sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" +# # sudo apt-get update +# # sudo apt-get install -y intel-basekit intel-hpckit +# # - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # tag=v3 +# # - name: make check +# # run: | +# # make CC=/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc check