diff options
Diffstat (limited to 'neozip/.github')
| -rw-r--r-- | neozip/.github/FUNDING.yml | 1 | ||||
| -rw-r--r-- | neozip/.github/dependabot.yml | 6 | ||||
| -rw-r--r-- | neozip/.github/workflows/analyze.yml | 82 | ||||
| -rw-r--r-- | neozip/.github/workflows/cmake.yml | 956 | ||||
| -rw-r--r-- | neozip/.github/workflows/codeql.yml | 54 | ||||
| -rw-r--r-- | neozip/.github/workflows/configure.yml | 289 | ||||
| -rw-r--r-- | neozip/.github/workflows/fuzz.yml | 42 | ||||
| -rw-r--r-- | neozip/.github/workflows/libpng.yml | 54 | ||||
| -rw-r--r-- | neozip/.github/workflows/link.yml | 71 | ||||
| -rw-r--r-- | neozip/.github/workflows/lint.yml | 19 | ||||
| -rw-r--r-- | neozip/.github/workflows/orchestrator.yml | 79 | ||||
| -rw-r--r-- | neozip/.github/workflows/osb.yml | 69 | ||||
| -rw-r--r-- | neozip/.github/workflows/pigz.yml | 135 | ||||
| -rw-r--r-- | neozip/.github/workflows/pkgcheck.yml | 189 | ||||
| -rw-r--r-- | neozip/.github/workflows/release.yml | 123 |
15 files changed, 2169 insertions, 0 deletions
diff --git a/neozip/.github/FUNDING.yml b/neozip/.github/FUNDING.yml new file mode 100644 index 0000000000..7cd8129153 --- /dev/null +++ b/neozip/.github/FUNDING.yml @@ -0,0 +1 @@ +github: zlib-ng diff --git a/neozip/.github/dependabot.yml b/neozip/.github/dependabot.yml new file mode 100644 index 0000000000..8ac6b8c498 --- /dev/null +++ b/neozip/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/neozip/.github/workflows/analyze.yml b/neozip/.github/workflows/analyze.yml new file mode 100644 index 0000000000..195bfde9cf --- /dev/null +++ b/neozip/.github/workflows/analyze.yml @@ -0,0 +1,82 @@ +name: Static Analysis +on: [workflow_call, workflow_dispatch] +jobs: + static-analysis: + name: GCC-14 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Add ubuntu mirrors + run: | + # Github Actions caching proxy is at times unreliable + echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list + + - name: Install packages (Ubuntu) + run: sudo apt-get install -y gcc-14 + + - name: Generate project files + run: | + cmake . \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DWITH_FUZZERS=OFF \ + -DWITH_CODE_COVERAGE=OFF \ + -DWITH_MAINTAINER_WARNINGS=OFF + env: + CC: gcc-14 + CFLAGS: + -fanalyzer + -Werror + -Wanalyzer-double-fclose + -Wanalyzer-double-free + -Wanalyzer-exposure-through-output-file + -Wanalyzer-file-leak + -Wanalyzer-free-of-non-heap + -Wanalyzer-malloc-leak + -Wanalyzer-null-argument + -Wanalyzer-null-dereference + -Wanalyzer-possible-null-argument + -Wanalyzer-possible-null-dereference + -Wanalyzer-stale-setjmp-buffer + -Wanalyzer-tainted-array-index + -Wanalyzer-unsafe-call-within-signal-handler + -Wanalyzer-use-after-free + -Wanalyzer-use-of-pointer-in-stale-stack-frame + CI: true + + - name: Compile source code + run: cmake --build . -j5 --config Release > /dev/null + + Clang: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Install packages (Ubuntu) + run: sudo apt-get install -y clang-tools + + - name: Generate project files + run: | + scan-build --status-bugs \ + cmake . \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DWITH_FUZZERS=OFF \ + -DWITH_CODE_COVERAGE=OFF \ + -DWITH_MAINTAINER_WARNINGS=OFF + env: + CI: true + + - name: Compile source code + run: | + scan-build --status-bugs \ + cmake --build . -j5 --config Release > /dev/null diff --git a/neozip/.github/workflows/cmake.yml b/neozip/.github/workflows/cmake.yml new file mode 100644 index 0000000000..7792571e51 --- /dev/null +++ b/neozip/.github/workflows/cmake.yml @@ -0,0 +1,956 @@ +name: CMake +on: [workflow_call, workflow_dispatch] +env: + TERM: xterm-256color + GTEST_COLOR: 1 + +jobs: + cmake: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + timeout-minutes: 80 + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC ASAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cxxflags: -Wno-maybe-uninitialized + cmake-args: -DWITH_SANITIZER=Address -DWITH_BENCHMARKS=ON + coverage: ubuntu_gcc + + - name: Ubuntu GCC Native Instructions + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON + coverage: ubuntu_gcc_native_inst + + - name: Ubuntu GCC Native Instructions (AVX) + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul" + coverage: ubuntu_gcc_native_inst_avx + + - name: Ubuntu GCC Symbol Prefix -O3 + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_ -DWITH_BENCHMARKS=ON + cflags: -O3 + # Skipping coverage to allow -O3 + + - name: Ubuntu GCC Compat Symbol Prefix + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DZLIB_COMPAT=ON -DZLIB_SYMBOL_PREFIX=zTest_ -DWITH_BENCHMARKS=ON + coverage: ubuntu_gcc_compat_sprefix + + - name: Ubuntu GCC -O1 UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_SANITIZER=Undefined + cflags: -O1 + # Skipping coverage to allow -O1 + + - name: Ubuntu GCC 32-bit + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_SHARED_LINKER_FLAGS=-m32 -DCMAKE_EXE_LINKER_FLAGS=-m32 -DWITH_BENCHMARKS=ON + packages: gcc-multilib g++-multilib + coverage: ubuntu_gcc_m32 + + - name: Ubuntu GCC C17 MMAP + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DCMAKE_C_STANDARD=17 + cflags: -DUSE_MMAP + coverage: ubuntu_gcc_c17_mmap + + - name: Ubuntu GCC C23 REDUCED_MEM + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DCMAKE_C_STANDARD=23 -DWITH_REDUCED_MEM=ON + coverage: ubuntu_gcc_c23_reduced_mem + + - name: Ubuntu GCC No Chorba + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_CHORBA=OFF + coverage: ubuntu_gcc_no_chorba + + - name: Ubuntu GCC SSE2 UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_SSSE3=OFF -DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_sse2 + + - name: Ubuntu GCC SSSE3 UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_SSE42=OFF -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_ssse3 + + - name: Ubuntu GCC SSE4.2 UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_AVX2=OFF -DWITH_AVX512=OFF -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_sse42 + + - name: Ubuntu GCC No PCLMULQDQ UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_PCLMULQDQ=OFF -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_no_pclmulqdq + + - name: Ubuntu GCC No AVX512VNNI UBSAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DWITH_AVX512VNNI=OFF -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_no_avx512vnni + + - name: Ubuntu GCC Compat No Opt ASAN + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_SANITIZER=Address + cflags: -DNOT_TWEAK_COMPILER + coverage: ubuntu_gcc_compat_no_opt + + - name: Ubuntu GCC ARM SF + os: ubuntu-24.04-arm + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake + packages: qemu-user crossbuild-essential-armel + gcov-exec: arm-linux-gnueabi-gcov + coverage: ubuntu_gcc_armsf + + - name: Ubuntu GCC ARM SF Compat No Opt + os: ubuntu-24.04-arm + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm.cmake -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF + packages: qemu-user crossbuild-essential-armel + gcov-exec: arm-linux-gnueabi-gcov + coverage: ubuntu_gcc_armsf_compat_no_opt + + - name: Ubuntu GCC ARM HF ASAN + os: ubuntu-24.04-arm + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_BENCHMARKS=ON -DWITH_SANITIZER=Address + cxxflags: -Wno-psabi -Wno-maybe-uninitialized + asan-options: detect_leaks=0 + packages: qemu-user crossbuild-essential-armhf + gcov-exec: arm-linux-gnueabihf-gcov + coverage: ubuntu_gcc_armhf_asan + + - name: Ubuntu GCC ARM HF No Neon No ARMv8 ASAN + os: ubuntu-24.04-arm + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DWITH_NEON=OFF -DWITH_ARMV8=OFF -DWITH_SANITIZER=Address + asan-options: detect_leaks=0 + packages: qemu-user crossbuild-essential-armhf + gcov-exec: arm-linux-gnueabihf-gcov + coverage: ubuntu_gcc_armhf_no_neon_no_armv8 + + - name: Ubuntu GCC ARM HF Compat UBSAN + os: ubuntu-24.04-arm + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DZLIB_COMPAT=ON -DWITH_SANITIZER=Undefined + packages: qemu-user crossbuild-essential-armhf + gcov-exec: arm-linux-gnueabihf-gcov + coverage: ubuntu_gcc_armhf_compat_ubsan + + - name: Ubuntu GCC AARCH64 ASAN + os: ubuntu-24.04-arm + cmake-args: -DWITH_BENCHMARKS=ON -DWITH_SANITIZER=Address + asan-options: detect_leaks=0 + coverage: ubuntu_gcc_aarch64_asan + + - name: Ubuntu GCC AARCH64 Compat UBSAN + os: ubuntu-24.04-arm + cmake-args: -DZLIB_COMPAT=ON -DWITH_SANITIZER=Undefined + coverage: ubuntu_gcc_aarch64_compat_ubsan + + - name: Ubuntu Clang AARCH64 MSAN + os: ubuntu-24.04-arm + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_SANITIZER=Memory + # Coverage disabled, causes MSAN errors + + - name: Ubuntu GCC MIPS + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips.cmake + packages: qemu-user crossbuild-essential-mips + gcov-exec: mips-linux-gnu-gcov + coverage: ubuntu_gcc_mips + + - name: Ubuntu GCC MIPS64 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips64.cmake -DWITH_BENCHMARKS=ON + packages: qemu-user crossbuild-essential-mips64 + gcov-exec: mips64-linux-gnuabi64-gcov + coverage: ubuntu_gcc_mips64 + + - name: Ubuntu GCC PPC + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake + packages: qemu-user crossbuild-essential-powerpc + gcov-exec: powerpc-linux-gnu-gcov + coverage: ubuntu_gcc_ppc + + - name: Ubuntu GCC PPC No Power8 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake -DWITH_POWER8=OFF + packages: qemu-user crossbuild-essential-powerpc + gcov-exec: powerpc-linux-gnu-gcov + coverage: ubuntu_gcc_ppc_no_power8 + + - name: Ubuntu GCC PPC64 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64.cmake -DWITH_BENCHMARKS=ON + packages: qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-ppc64-cross + ldflags: -static + gcov-exec: powerpc64-linux-gnu-gcov + coverage: ubuntu_gcc_ppc64 + + - name: Ubuntu GCC PPC64 Power9 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-power9.cmake + packages: qemu-user gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu libc-dev-ppc64-cross + ldflags: -static + gcov-exec: powerpc64-linux-gnu-gcov + coverage: ubuntu_gcc_ppc64_power9 + + - name: Ubuntu Clang PPC64 Power9 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64-clang.cmake + packages: qemu-user clang binutils-powerpc64-linux-gnu libgcc-11-dev-ppc64-cross libc-dev-ppc64-cross libstdc++-11-dev-ppc64-cross + # Coverage disabled for clang on power9, errors + + - name: Ubuntu GCC PPC64LE + os: ubuntu-latest + # gtest illegal instruction (related? https://bugs.launchpad.net/qemu/+bug/1781281) + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le.cmake -DWITH_GTEST=OFF + packages: qemu-user crossbuild-essential-ppc64el + gcov-exec: powerpc64le-linux-gnu-gcov + # mcpu required to test power8 with qemu-ppc64le -cpu power8 (see issue 1378) + cflags: -mcpu=power8 + cxxflags: -mcpu=power8 + coverage: ubuntu_gcc_ppc64le + + - name: Ubuntu GCC PPC64LE No VSX + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake -DWITH_POWER8=OFF -DWITH_POWER9=OFF + packages: qemu-user crossbuild-essential-ppc64el + gcov-exec: powerpc64le-linux-gnu-gcov + coverage: ubuntu_gcc_ppc64le_novsx + + - name: Ubuntu GCC PPC64LE Power9 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-power9.cmake + packages: qemu-user crossbuild-essential-ppc64el + gcov-exec: powerpc64le-linux-gnu-gcov + coverage: ubuntu_gcc_ppc64le_power9 + + - name: Ubuntu Clang PPC64LE Power9 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le-clang.cmake + packages: qemu-user crossbuild-essential-ppc64el + # Coverage disabled for clang on power9, errors + + - name: Ubuntu GCC RISC-V + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv.cmake -DWITH_BENCHMARKS=ON + packages: qemu-user crossbuild-essential-riscv64 + gcov-exec: riscv64-linux-gnu-gcov + coverage: ubuntu_gcc_riscv64 + + - name: Ubuntu Clang RISC-V + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv-clang.cmake + packages: qemu-user crossbuild-essential-riscv64 + # Coverage disabled for clang on riscv, errors + + - name: Ubuntu GCC 14 LoongArch64 + os: ubuntu-latest + cmake-args: -DCOMPILER_SUFFIX=-14 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-loongarch64-gcc.cmake -DWITH_BENCHMARKS=ON + packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross + ldflags: -static + gcov-exec: loongarch64-linux-gnu-gcov-14 + coverage: ubuntu_gcc14_loongarch64 + + - name: Ubuntu GCC 14 LoongArch64 No LASX + os: ubuntu-latest + cmake-args: -DCOMPILER_SUFFIX=-14 -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-loongarch64-gcc.cmake -DWITH_BENCHMARKS=ON -DWITH_LASX=OFF + packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross + ldflags: -static + gcov-exec: loongarch64-linux-gnu-gcov-14 + coverage: ubuntu_gcc14_loongarch64_no_lasx + + - name: Ubuntu GCC SPARC64 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sparc64.cmake + packages: qemu-user gcc-sparc64-linux-gnu g++-sparc64-linux-gnu libc-dev-sparc64-cross + ldflags: -static + gcov-exec: sparc64-linux-gnu-gcov + coverage: ubuntu_gcc_sparc64 + + - name: Ubuntu GCC S390x + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_BENCHMARKS=ON + packages: qemu-user crossbuild-essential-s390x + ldflags: -static + gcov-exec: s390x-linux-gnu-gcov + coverage: ubuntu_gcc_s390x + + - name: Ubuntu GCC S390X No vectorized CRC32 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DWITH_CRC32_VX=OFF + packages: qemu-user crossbuild-essential-s390x + ldflags: -static + gcov-exec: s390x-linux-gnu-gcov + coverage: ubuntu_gcc_s390x_no_crc32 + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10' || 'Ubuntu' }} GCC S390X DFLTCC Compat + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: gcc + cxx-compiler: g++ + cmake-args: >- + ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }} + -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_BENCHMARKS=ON -DZLIB_COMPAT=ON + packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross + ldflags: -static + gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcov' || 's390x-linux-gnu-gcov' }} + coverage: ${{ github.repository == 'zlib-ng/zlib-ng' && 'el10_gcc_s390x_dfltcc' || 'ubuntu_gcc_s390x_dfltcc' }} + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10 Clang S390X DFLTCC ASAN' || 'Ubuntu GCC S390X DFLTCC' }} + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang' || 'gcc' }} + cxx-compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang++' || 'g++' }} + cmake-args: >- + ${{ github.repository == 'zlib-ng/zlib-ng' && '-DWITH_SANITIZER=Address' || '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' }} + -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON + packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross + asan-options: detect_leaks=0 + gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'llvm-cov gcov' || 's390x-linux-gnu-gcov' }} + coverage: ${{ github.repository == 'zlib-ng/zlib-ng' && 'el10_clang_s390x_dfltcc_asan' || 'ubuntu_gcc_s390x_dfltcc' }} + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10 Clang' || 'Ubuntu GCC' }} S390X DFLTCC UBSAN + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang' || 'gcc' }} + cxx-compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang++' || 'g++' }} + cmake-args: >- + ${{ github.repository != 'zlib-ng/zlib-ng' && '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake' || '' }} + -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON -DWITH_SANITIZER=Undefined + packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross + gcov-exec: ${{ github.repository == 'zlib-ng/zlib-ng' && 'llvm-cov gcov' || 's390x-linux-gnu-gcov' }} + coverage: ${{ github.repository == 'zlib-ng/zlib-ng' && 'el10_clang_s390x_dfltcc_ubsan' || 'ubuntu_gcc_s390x_dfltcc_ubsan' }} + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10 Clang' || 'Ubuntu GCC' }} S390X DFLTCC ${{ (github.repository == 'zlib-ng/zlib-ng' && 'MSAN') || 'Compat' }} + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang' || 'gcc' }} + cxx-compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'clang++' || 'g++' }} + cmake-args: >- + ${{ github.repository == 'zlib-ng/zlib-ng' && '-GNinja -DWITH_SANITIZER=Memory' || '-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-s390x.cmake -DZLIB_COMPAT=ON' }} + -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON + packages: qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross + # Coverage disabled, causes MSAN errors + + - name: Ubuntu MinGW i686 + os: ubuntu-22.04 + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-i686.cmake + packages: wine wine32 gcc-mingw-w64-i686 g++-mingw-w64-i686 libpcre2-8-0=10.39-3ubuntu0.1 libpcre2-8-0:i386=10.39-3ubuntu0.1 libodbc1=2.3.9-5ubuntu0.1 libodbc1:i386=2.3.9-5ubuntu0.1 libodbc2=2.3.9-5ubuntu0.1 libodbc2:i386=2.3.9-5ubuntu0.1 libodbccr2=2.3.9-5ubuntu0.1 libodbccr2:i386=2.3.9-5ubuntu0.1 libwine:i386=6.0.3~repack-1 libgphoto2-6:i386=2.5.27-1build2 libsane:i386=1.1.1-5 libgd3=2.3.0-2ubuntu2 libgd3:i386=2.3.0-2ubuntu2 libgcc-s1:i386 libstdc++6:i386 + ldflags: -static + gcov-exec: i686-w64-mingw32-gcov-posix + coverage: ubuntu_gcc_mingw_i686 + # Limit parallel test jobs to prevent wine errors + parallel-jobs: 1 + + - name: Ubuntu MinGW x86_64 + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mingw-x86_64.cmake -DWITH_BENCHMARKS=ON + packages: wine wine64 gcc-mingw-w64 g++-mingw-w64 + cxxflags: -Wno-unused-parameter + ldflags: -static + gcov-exec: x86_64-w64-mingw32-gcov-posix + coverage: ubuntu_gcc_mingw_x86_64 + # Limit parallel test jobs to prevent wine errors + parallel-jobs: 1 + + - name: Ubuntu Clang-15 + os: ubuntu-latest + compiler: clang-15 + cxx-compiler: clang++-15 + cmake-args: -DCMAKE_LINKER_TYPE=LLD + packages: clang-15 lld + gcov-exec: llvm-cov-15 gcov + # Coverage disabled for clang-15, errors + + - name: Ubuntu Clang C17 MMAP + os: ubuntu-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DCMAKE_LINKER_TYPE=LLD -DCMAKE_C_STANDARD=17 + cflags: -DUSE_MMAP + packages: llvm-18 lld + gcov-exec: llvm-cov-18 gcov + coverage: ubuntu_clang_c17_mmap + + - name: Ubuntu Clang-20 C23 + os: ubuntu-latest + compiler: clang-20 + cxx-compiler: clang++-20 + cmake-args: -DCMAKE_LINKER_TYPE=LLD -DCMAKE_C_STANDARD=23 + packages: clang-20 lld + # Coverage disabled for clang-20, errors + + # Check for undefined symbols in the version script for the modern api + - name: Ubuntu Clang-20 Undefined Symbols + os: ubuntu-latest + compiler: clang-20 + cxx-compiler: clang++-20 + cmake-args: -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF + build-shared: 'ON' + packages: clang-20 lld + # Coverage disabled, no tests run + + # Check for undefined symbols in the version script for the compat api + - name: Ubuntu Clang-20 Undefined Symbols Compat + os: ubuntu-latest + compiler: clang-20 + cxx-compiler: clang++-20 + cmake-args: -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld -Wl,--no-undefined-version" -DZLIBNG_ENABLE_TESTS=OFF -DZLIB_COMPAT=ON + build-shared: 'ON' + packages: clang-20 lld + # Coverage disabled, no tests run + + - name: Ubuntu Clang Inflate Strict REDUCED_MEM + os: ubuntu-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_INFLATE_STRICT=ON -DWITH_REDUCED_MEM=ON + packages: llvm-18 + gcov-exec: llvm-cov-18 gcov + coverage: ubuntu_clang_inflate_strict_reduced_mem + + - name: Ubuntu Clang Inflate Allow Invalid Dist + os: ubuntu-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_INFLATE_ALLOW_INVALID_DIST=ON + packages: llvm-18 + gcov-exec: llvm-cov-18 gcov + coverage: ubuntu_clang_inflate_allow_invalid_dist + + - name: Ubuntu Clang Compat Debug + os: ubuntu-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DZLIB_COMPAT=ON + packages: llvm-18 + gcov-exec: llvm-cov-18 gcov + build-config: Debug + coverage: ubuntu_clang_compat_debug + + - name: Ubuntu Clang-20 MSAN + os: ubuntu-latest + compiler: clang-20 + cxx-compiler: clang++-20 + cmake-args: -GNinja -DWITH_SANITIZER=Memory + packages: ninja-build clang-20 llvm-20 libclang-rt-20-dev + gcov-exec: llvm-cov-20 gcov + build-config: Debug + # https://github.com/llvm/llvm-project/issues/55785 + msan-options: use_sigaltstack=0 + # Coverage disabled for clang-20, errors + + - name: Ubuntu Emscripten WASM32 + os: ubuntu-latest + chost: wasm32 + cmake-args: -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_C_COMPILER_TARGET=wasm32 -DCMAKE_CROSSCOMPILING_EMULATOR=${EMSDK_NODE} -DZLIB_COMPAT=ON + # Coverage disabled for wasm + + - name: Windows MSVC 2026 v145 Win64 C23 + os: windows-2025-vs2026 + compiler: cl + cmake-args: -G "Visual Studio 18 2026" -A x64 -T v145 -DCMAKE_C_STANDARD=23 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v143 Win32 + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A Win32 -T v143 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v143 Win64 + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v143 Win64 Native Instructions (AVX) + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE=/arch:AVX + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v143 Win64 C17 + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64 -T v143 -DCMAKE_C_STANDARD=17 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v142 Win32 + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A Win32 -T v142 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v142 Win64 + os: windows-latest + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64 -T v142 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v141 Win32 + os: windows-2022 + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A Win32 -T v141 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v141 Win64 + os: windows-2022 + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64 -T v141 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v140 Win32 + os: windows-2022 + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A Win32,version=10.0.14393.0 -T v140 -DCMAKE_SYSTEM_VERSION=10.0.14393.0 + # Coverage disabled for msvc + + - name: Windows MSVC 2022 v140 Win64 + os: windows-2022 + compiler: cl + cmake-args: -G "Visual Studio 17 2022" -A x64,version=10.0.14393.0 -T v140 -DCMAKE_SYSTEM_VERSION=10.0.14393.0 + # Coverage disabled for msvc + + - name: Windows MSVC ARM No Test + os: windows-latest + compiler: cl + cmake-args: -A ARM,version=10.0.22621.0 + # Coverage disabled for msvc + + - name: Windows MSVC ARM64 + os: windows-11-arm + compiler: cl + cmake-args: -A ARM64 + # Coverage disabled for msvc + + - name: Windows MSVC ARM64EC + os: windows-11-arm + compiler: cl + cmake-args: -A ARM64EC + # Coverage disabled for msvc + + - name: Windows ClangCl Win32 + os: windows-latest + cmake-args: -T ClangCl -A Win32 + # Coverage disabled for clangcl + + - name: Windows ClangCl Win64 + os: windows-latest + cmake-args: -T ClangCl -A x64 + # Coverage disabled for clangcl + + - name: Windows ClangCl Win64 Native Instructions (AVX) + os: windows-latest + cmake-args: -T ClangCl -A x64 -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul" + # Coverage disabled for clangcl + + - name: Windows GCC + os: windows-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -G Ninja + coverage: win64_gcc + + - name: Windows GCC Native Instructions (AVX) + os: windows-2022 + compiler: gcc + cxx-compiler: g++ + cmake-args: -G Ninja -DWITH_NATIVE_INSTRUCTIONS=ON -DNATIVE_ARCH_OVERRIDE="-mavx -mpclmul" + coverage: win64_gcc_native_avx + + - name: Windows GCC Compat No Opt + os: windows-latest + compiler: gcc + cxx-compiler: g++ + cmake-args: -G Ninja -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF + coverage: win64_gcc_compat_no_opt + + - name: macOS Clang (Intel, Target 10.10) + os: macos-15-intel + compiler: clang + cxx-compiler: clang++ + cmake-args: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 -DWITH_BENCHMARKS=ON + ldflags: -ld_classic + coverage: macos_clang_intel + + - name: macOS Clang (Intel) ASAN + os: macos-15-intel + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_SANITIZER=Address + coverage: macos_clang_intel_asan + + - name: macOS Clang (Intel) UBSAN + os: macos-15-intel + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_SANITIZER=Undefined + coverage: macos_clang_intel_ubsan + + - name: macOS Clang (Intel) Native Instructions + os: macos-15-intel + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON + coverage: macos_clang_native_intel + + - name: macOS Clang (ARM64) ASAN + os: macos-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_SANITIZER=Address + coverage: macos_clang_arm64 + + - name: macOS Clang (ARM64) UBSAN + os: macos-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_SANITIZER=Undefined + coverage: macos_clang_arm64_ubsan + + - name: macOS Clang (ARM64) Native Instructions + os: macos-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DWITH_NATIVE_INSTRUCTIONS=ON + coverage: macos_clang_arm64_native + + - name: Ubuntu LCC e2kv4 + os: ubuntu-latest + cmake-args: -DWITH_BENCHMARKS=ON -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-e2k-lcc.cmake -DMCST_LCC_PREFIX=/opt/mcst/lcc-1.29.16.e2k-v4.linux-6.1 -DQEMU_CPU=elbrus-v4 -DBENCHMARK_ENABLE_WERROR=OFF -DBENCHMARK_FORCE_WERROR=OFF + toolchain: 1.29.16.e2k-v4.linux-6.1 + cflags: -march=elbrus-v4 + cxxflags: -march=elbrus-v4 -DBENCHMARK_HAS_NO_INLINE_ASSEMBLY + ldflags: -static + # Skipping coverage to allow optimized build + + - name: Ubuntu LCC e2kv5 + os: ubuntu-latest + cmake-args: -DWITH_BENCHMARKS=ON -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-e2k-lcc.cmake -DMCST_LCC_PREFIX=/opt/mcst/lcc-1.29.16.e2k-v5.linux-6.1 -DQEMU_CPU=elbrus-v5 -DBENCHMARK_ENABLE_WERROR=OFF -DBENCHMARK_FORCE_WERROR=OFF + toolchain: 1.29.16.e2k-v5.linux-6.1 + cflags: -march=elbrus-v5 + cxxflags: -march=elbrus-v5 -DBENCHMARK_HAS_NO_INLINE_ASSEMBLY + ldflags: -static + # Skipping coverage to allow optimized build + + - name: Ubuntu LCC e2kv5 (coverage) + os: ubuntu-latest + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-e2k-lcc.cmake -DMCST_LCC_PREFIX=/opt/mcst/lcc-1.29.16.e2k-v5.linux-6.1 -DQEMU_CPU=elbrus-v5 + toolchain: 1.29.16.e2k-v5.linux-6.1 + cflags: -march=elbrus-v5 + cxxflags: -march=elbrus-v5 + ldflags: -static + gcov-exec: /opt/mcst/lcc-1.29.16.e2k-v5.linux-6.1/gcov/bin/gcov + coverage: linux_mcst_lcc_e2kv5 + + - name: Ubuntu LCC e2kv6 + os: ubuntu-latest + cmake-args: -DWITH_BENCHMARKS=ON -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-e2k-lcc.cmake -DMCST_LCC_PREFIX=/opt/mcst/lcc-1.29.16.e2k-v6.linux-6.1 -DQEMU_CPU=elbrus-v6 -DBENCHMARK_ENABLE_WERROR=OFF -DBENCHMARK_FORCE_WERROR=OFF + toolchain: 1.29.16.e2k-v6.linux-6.1 + cflags: -march=elbrus-v6 + cxxflags: -march=elbrus-v6 -DBENCHMARK_HAS_NO_INLINE_ASSEMBLY + ldflags: -static + # Skipping coverage to allow optimized build + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: false + + - name: Checkout test corpora + uses: actions/checkout@v6 + # Don't test against all corpora with MinGW due to Wine being unable to run parallel jobs + # without connection timeout. Without parallel jobs test runs using Wine take close to an hour. + # Also don't test the extra corpora with Sanitizer builds or RISC-V or e2k, due to their slow testing. + if: ${{ !contains(matrix.name, 'MinGW') && !contains(matrix.name, 'RISC-V') && !contains(matrix.name, 'e2k') && !contains(matrix.cmake-args, 'WITH_SANITIZER') }} + with: + repository: zlib-ng/corpora + path: test/data/corpora + show-progress: false + + - name: Add repositories (Wine) + if: contains(matrix.packages, 'wine32') + run: sudo dpkg --add-architecture i386 + + - name: Add ubuntu mirrors + if: runner.os == 'Linux' && !contains(matrix.os, 'z15') + # Github Actions caching proxy is at times unreliable + run: | + echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list + + - name: Install packages (Ubuntu) + if: runner.os == 'Linux' && !contains(matrix.os, 'z15') + run: | + sudo apt-get update + sudo apt-get install -y --allow-downgrades --no-install-recommends \ + ${{ matrix.packages || 'libgtest-dev libbenchmark-dev' }} + + - name: Install packages (Windows) + if: runner.os == 'Windows' + run: | + # strawberryperl installs /c/Strawberry/c/bin/libstdc++-6.dll, which is incompatible with the mingw64 one. + # zlib-ng does not need perl, so simply remove it. + choco uninstall --no-progress strawberryperl + choco install --no-progress ninja ${{ matrix.packages }} + + - name: Install Visual Studio toolset v140 (Windows) + if: contains(matrix.name, 'v140') + run: | + # Windows 10 SDK (10.0.14393.795) + # https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/index-legacy + Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=838916 -OutFile sdksetup.exe -UseBasicParsing + Unblock-File sdksetup.exe + Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit" + + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $componentsToInstall= @( + "Microsoft.VisualStudio.Component.VC.140" + ) + [string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_} + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') + # should be run twice + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + + - name: Install Visual Studio toolset v141 (Windows) + if: contains(matrix.name, 'v141') + run: | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + $componentsToInstall= @( + "Microsoft.VisualStudio.Component.VC.v141.x86.x64" + ) + [string]$workloadArgs = $componentsToInstall | ForEach-Object {" --add " + $_} + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') + # should be run twice + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + + - name: Install Windows 11 SDK (ARM) + if: contains(matrix.name, 'MSVC ARM ') + run: | + # Windows 11 SDK (10.0.22621.2428) + # https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/index-legacy + Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=2250105 -OutFile sdksetup.exe -UseBasicParsing + Unblock-File sdksetup.exe + Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/ceip off" + + - name: Install packages (macOS) + if: runner.os == 'macOS' + run: brew install ninja ${{ matrix.packages }} + env: + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: Install Emscripten + if: contains(matrix.name, 'WASM32') + uses: mymindstorm/setup-emsdk@v14 + + # Get MCST LCC from github actions cache or download from dev.mcst.ru and save to cache + - name: Cache MCST LCC ${{ matrix.toolchain }} (Ubuntu) + if: contains(matrix.name, 'e2k') + id: cache-lcc + uses: actions/cache@v5 + with: + path: /opt/mcst + key: cache-lcc-${{ matrix.toolchain }} + + - name: Install MCST LCC ${{ matrix.toolchain }} (Ubuntu) + if: contains(matrix.name, 'e2k') && steps.cache-lcc.outputs.cache-hit != 'true' + shell: bash + run: | + wget -q https://dev.mcst.ru/downloads/2026-03-13/cross-sp-public-osl-${{ matrix.toolchain }}_64.tgz + sudo tar -xzf cross-sp-public-osl-${{ matrix.toolchain }}_64.tgz -C / + rm -f cross-sp-public-osl-${{ matrix.toolchain }}_64.tgz + + # Get qemu-e2k-static from github actions cache or download from dev.mcst.ru and save to cache + - name: Cache MCST QEMU (Ubuntu) + if: contains(matrix.name, 'e2k') + id: cache-qemu-e2k-static + uses: actions/cache@v5 + with: + path: /usr/local/bin/qemu-e2k-static + key: cache-qemu-e2k-static-2026-02-24 + + - name: Install MCST QEMU (Ubuntu) + if: contains(matrix.name, 'e2k') && steps.cache-qemu-e2k-static.outputs.cache-hit != 'true' + shell: bash + run: | + wget -q https://dev.mcst.ru/downloads/2026-02-24/qemu-e2k-static + chmod +x qemu-e2k-static + sudo mv qemu-e2k-static /usr/local/bin + + - name: Initialize Wine + # Prevent parallel test jobs from initializing Wine at the same time + if: contains(matrix.packages, 'wine') + run: wineboot --init + + - name: Set LLVM_BUILD_DIR for LLVM C++ libraries (MSAN) + if: contains(matrix.name, 'MSAN') && startsWith(matrix.compiler, 'clang') + run: | + echo "LLVM_BUILD_DIR=`pwd`/llvm-project/build" >> $GITHUB_ENV + + - name: Get latest hash change for LLVM C++ libraries (MSAN) + if: contains(matrix.name, 'MSAN') && startsWith(matrix.compiler, 'clang') + id: llvm-remote-hash + run: | + HASH=$(git ls-remote https://github.com/llvm/llvm-project refs/heads/release/20.x | cut -f1) + if [ -z "$HASH" ]; then + echo "Failed to fetch LLVM remote hash" + exit 1 + fi + echo "value=$HASH" >> $GITHUB_OUTPUT + + - name: Cache LLVM C++ libraries (MSAN) + if: contains(matrix.name, 'MSAN') && startsWith(matrix.compiler, 'clang') + id: cache-llvm + uses: actions/cache@v5 + with: + path: | + ${{ env.LLVM_BUILD_DIR }}/lib + ${{ env.LLVM_BUILD_DIR }}/include + key: cache-llvm-${{ matrix.os }}-${{ runner.arch }}-${{ matrix.compiler }}-${{ steps.llvm-remote-hash.outputs.value }} + + - name: Compile LLVM C++ libraries (MSAN) + if: contains(matrix.name, 'MSAN') && startsWith(matrix.compiler, 'clang') && steps.cache-llvm.outputs.cache-hit != 'true' + run: | + # Use sparse-checkout to download only the folders we need (176MB instead of 2302MB) + git clone --depth=1 --filter=blob:none https://github.com/llvm/llvm-project --no-checkout --branch release/20.x + cd llvm-project + git sparse-checkout set cmake runtimes libc libcxx libcxxabi llvm/cmake + git checkout + cmake -S runtimes -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ + -DLLVM_USE_SANITIZER=MemoryWithOrigins \ + -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \ + -DLIBCXX_ENABLE_STATIC=OFF \ + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_INCLUDE_DOCS=OFF + cmake --build build -j5 -- cxx cxxabi + env: + CFLAGS: -O2 + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + + - name: Generate project files + shell: bash + # Shared libraries turned off for qemu ppc* and sparc & reduce code coverage sources + run: | + cmake -S . ${{ matrix.cmake-args }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} \ + -DBUILD_SHARED_LIBS=${{ matrix.build-shared || 'OFF' }} \ + -DWITH_FUZZERS=ON \ + -DWITH_MAINTAINER_WARNINGS=ON \ + ${{ matrix.coverage && '-DWITH_CODE_COVERAGE=ON' }} + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + CFLAGS: ${{ matrix.cflags }} + CXXFLAGS: ${{ matrix.cxxflags }} + LDFLAGS: ${{ matrix.ldflags }} + CI: true + + - name: Compile source code + run: cmake --build . --verbose -j5 --config ${{ matrix.build-config || 'Release' }} + + - name: Run test cases + # Don't run tests on 32-bit Windows ARM + if: runner.os != 'Windows' || contains(matrix.name, 'ARM') == false || runner.arch == 'ARM64' + run: ctest --verbose -C ${{ matrix.build-config || 'Release' }} -E benchmark_zlib --output-on-failure --max-width 120 -j ${{ matrix.parallel-jobs || '5' }} + env: + ASAN_OPTIONS: ${{ matrix.asan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + TSAN_OPTIONS: ${{ matrix.tsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + LSAN_OPTIONS: ${{ matrix.lsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + UBSAN_OPTIONS: ${{ matrix.ubsan-options || 'verbosity=0' }}:print_stacktrace=1:abort_on_error=1:halt_on_error=1 + + - name: Generate coverage report + if: matrix.coverage + shell: bash + run: | + python3 -u -m venv ./venv + source ./venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/activate + python3 -u -m pip install gcovr + python3 -m gcovr -j 5 --gcov-ignore-parse-errors --verbose \ + --exclude '(.*/|^)(_deps|benchmarks)/.*' \ + --exclude-unreachable-branches \ + --merge-mode-functions separate \ + --merge-lines \ + --gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \ + --xml --output ${{ matrix.coverage }}.xml + + - name: Upload job coverage report to coveralls + uses: coverallsapp/github-action@v2 + env: + COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" + if: | + matrix.codecov + && !contains(matrix.os, 'z15') + && (env.COVERALLS_REPO_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + with: + file: ${{ matrix.coverage }}.xml + flag-name: "${{ matrix.name }}-${{ github.event_name }}" + parallel: true + + - name: Test benchmarks (crashtest only, no coverage data collection) + if: contains(matrix.cmake-args, '-DWITH_BENCHMARKS=ON') + run: ctest --verbose -C Release -R ^benchmark_zlib$ --output-on-failure --max-width 120 -j ${{ matrix.parallel-jobs || '5' }} + env: + ASAN_OPTIONS: ${{ matrix.asan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + TSAN_OPTIONS: ${{ matrix.tsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + LSAN_OPTIONS: ${{ matrix.lsan-options || 'verbosity=0' }}:abort_on_error=1:halt_on_error=1 + UBSAN_OPTIONS: ${{ matrix.ubsan-options || 'verbosity=0' }}:print_stacktrace=1:abort_on_error=1:halt_on_error=1 + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: ${{ matrix.name }} (cmake) + path: | + **/CMakeFiles/CMakeConfigureLog.yaml + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log + **/Testing/Temporary/* + ${{ matrix.coverage }}.xml + retention-days: 30 diff --git a/neozip/.github/workflows/codeql.yml b/neozip/.github/workflows/codeql.yml new file mode 100644 index 0000000000..972c694487 --- /dev/null +++ b/neozip/.github/workflows/codeql.yml @@ -0,0 +1,54 @@ +name: CodeQL +on: + workflow_call: + workflow_dispatch: + schedule: + - cron: "27 17 * * 0" + +jobs: + analyze: + name: CodeQL (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + # https://codeql.github.com/docs/codeql-overview/system-requirements/ + os: + - ubuntu-latest + - macos-latest + - macos-26-intel + - windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: cpp + queries: +security-and-quality + + - name: Build default config + shell: bash + run: | + cmake -B build-default -S . ${{ runner.os == 'Windows' && '-A x64' || '' }} + cmake --build build-default -j4 + + - name: Build compat config without optim/strategies, with reduced mem + shell: bash + run: | + cmake -B build-compat -S . -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DWITH_OPTIM=OFF -DWITH_REDUCED_MEM=ON ${{ runner.os == 'Windows' && '-A x64' || '' }} + cmake --build build-compat -j4 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/oss:${{ matrix.os }}" diff --git a/neozip/.github/workflows/configure.yml b/neozip/.github/workflows/configure.yml new file mode 100644 index 0000000000..952ab847ab --- /dev/null +++ b/neozip/.github/workflows/configure.yml @@ -0,0 +1,289 @@ +name: Configure +on: [workflow_call, workflow_dispatch] +jobs: + configure: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC + os: ubuntu-latest + compiler: gcc + configure-args: --warn + + - name: Ubuntu GCC OSB Symbol Prefix No VPCLMUL + os: ubuntu-latest + compiler: gcc + configure-args: --warn --sprefix=zTest_ --without-vpclmulqdq + build-dir: ../build + build-src-dir: ../zlib-ng + + - name: Ubuntu GCC Compat No Opt Reduced Mem + os: ubuntu-latest + compiler: gcc + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies --with-reduced-mem + + - name: Ubuntu GCC Compat Symbol Prefix + os: ubuntu-latest + compiler: gcc + configure-args: --warn --zlib-compat --sprefix=zTest_ + + - name: Ubuntu GCC ARM SF + os: ubuntu-24.04-arm + compiler: arm-linux-gnueabi-gcc + configure-args: --warn + chost: arm-linux-gnueabi + packages: qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross + + - name: Ubuntu GCC ARM SF Compat No Opt No Gzfileops + os: ubuntu-24.04-arm + compiler: arm-linux-gnueabi-gcc + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies --without-gzfileops + chost: arm-linux-gnueabi + packages: qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross + + - name: Ubuntu GCC ARM HF + os: ubuntu-24.04-arm + compiler: arm-linux-gnueabihf-gcc + configure-args: --warn + chost: arm-linux-gnueabihf + packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross + + - name: Ubuntu GCC ARM HF No Neon No ARMv8 + os: ubuntu-24.04-arm + compiler: arm-linux-gnueabihf-gcc + configure-args: --warn --without-neon --without-armv8 + chost: arm-linux-gnueabihf + packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross + + - name: Ubuntu GCC ARM HF Compat No Opt + os: ubuntu-24.04-arm + compiler: arm-linux-gnueabihf-gcc + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies + chost: arm-linux-gnueabihf + packages: qemu-user gcc-arm-linux-gnueabihf libc-dev-armel-cross + + - name: Ubuntu GCC AARCH64 + os: ubuntu-24.04-arm + compiler: gcc + configure-args: --warn + + - name: Ubuntu GCC AARCH64 Compat No Opt + os: ubuntu-24.04-arm + compiler: gcc + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies + + - name: Ubuntu GCC MIPS + os: ubuntu-latest + compiler: mips-linux-gnu-gcc + configure-args: --warn + chost: mips-linux-gnu + packages: qemu-user gcc-mips-linux-gnu libc-dev-mips-cross + + - name: Ubuntu GCC MIPS64 + os: ubuntu-latest + compiler: mips64-linux-gnuabi64-gcc + configure-args: --warn + chost: mips64-linux-gnuabi64 + packages: qemu-user gcc-mips64-linux-gnuabi64 libc-dev-mips64-cross + + - name: Ubuntu GCC PPC + os: ubuntu-latest + compiler: powerpc-linux-gnu-gcc + configure-args: --warn --static + chost: powerpc-linux-gnu + packages: qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross + cflags: -static + ldflags: -static + + - name: Ubuntu GCC PPC No Opt + os: ubuntu-latest + compiler: powerpc-linux-gnu-gcc + configure-args: --warn --without-optimizations + chost: powerpc-linux-gnu + packages: qemu-user gcc-powerpc-linux-gnu libc-dev-powerpc-cross + + - name: Ubuntu GCC PPC64 + os: ubuntu-latest + compiler: powerpc64-linux-gnu-gcc + configure-args: --warn --static + chost: powerpc-linux-gnu + packages: qemu-user gcc-powerpc64-linux-gnu libc-dev-ppc64-cross + cflags: -static + ldflags: -static + + - name: Ubuntu GCC PPC64LE + os: ubuntu-latest + compiler: powerpc64le-linux-gnu-gcc + configure-args: --warn + chost: powerpc64le-linux-gnu + packages: qemu-user gcc-powerpc64le-linux-gnu libc-dev-ppc64el-cross + + - name: Ubuntu GCC S390X + os: ubuntu-latest + compiler: s390x-linux-gnu-gcc + configure-args: --warn --static + chost: s390x-linux-gnu + packages: qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross + cflags: -static + ldflags: -static + + - name: Ubuntu GCC S390X No vectorized CRC32 + os: ubuntu-latest + compiler: s390x-linux-gnu-gcc + configure-args: --warn --static --without-crc32-vx + chost: s390x-linux-gnu + packages: qemu-user gcc-s390x-linux-gnu libc-dev-s390x-cross + cflags: -static + ldflags: -static + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10' || 'Ubuntu' }} GCC S390X DFLTCC + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }} + configure-args: --warn --static --with-dfltcc-deflate --with-dfltcc-inflate + chost: ${{ github.repository != 'zlib-ng/zlib-ng' && 's390x-linux-gnu' || '' }} + packages: ${{ github.repository != 'zlib-ng/zlib-ng' && 'qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross' || '' }} + cflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }} + ldflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }} + + - name: ${{ github.repository == 'zlib-ng/zlib-ng' && 'EL10' || 'Ubuntu' }} GCC S390X DFLTCC Compat + os: ${{ github.repository == 'zlib-ng/zlib-ng' && 'z15' || 'ubuntu-latest' }} + compiler: ${{ github.repository == 'zlib-ng/zlib-ng' && 'gcc' || 's390x-linux-gnu-gcc' }} + configure-args: --warn --zlib-compat --static --with-dfltcc-deflate --with-dfltcc-inflate + chost: ${{ github.repository != 'zlib-ng/zlib-ng' && 's390x-linux-gnu' || '' }} + packages: ${{ github.repository != 'zlib-ng/zlib-ng' && 'qemu-user gcc-s390x-linux-gnu g++-s390x-linux-gnu libc-dev-s390x-cross' || '' }} + cflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }} + ldflags: ${{ github.repository != 'zlib-ng/zlib-ng' && '-static' || '' }} + + - name: Ubuntu Emscripten WASM32 + os: ubuntu-latest + chost: wasm32 + configure-args: --warn --zlib-compat --static + configure-prefix: emconfigure + cflags: -static + ldflags: -static + emu-run: node + + - name: macOS Clang (Intel) + os: macos-15-intel + compiler: clang + configure-args: --warn + + - name: macOS Clang (Intel) Compat No Opt + os: macos-15-intel + compiler: clang + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies + + - name: macOS Clang (ARM64) + os: macos-latest + compiler: clang + cflags: -std=gnu11 + configure-args: --warn + + - name: macOS Clang (ARM64) Compat No Opt + os: macos-latest + compiler: clang + cflags: -std=gnu11 + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies + + - name: Ubuntu GCC RISCV64 + os: ubuntu-latest + compiler: riscv64-linux-gnu-gcc + configure-args: --warn + chost: riscv64-linux-gnu + packages: qemu-user crossbuild-essential-riscv64 + + - name: Ubuntu GCC RISCV64 No RVV No ZBC + os: ubuntu-latest + compiler: riscv64-linux-gnu-gcc + configure-args: --warn --without-rvv --without-zbc + chost: riscv64-linux-gnu + packages: qemu-user crossbuild-essential-riscv64 + + - name: Ubuntu GCC RISCV64 Compat No Opt + os: ubuntu-latest + compiler: riscv64-linux-gnu-gcc + configure-args: --warn --zlib-compat --without-optimizations --without-new-strategies + chost: riscv64-linux-gnu + packages: qemu-user crossbuild-essential-riscv64 + + - name: Ubuntu GCC 14 LoongArch64 + os: ubuntu-latest + compiler: loongarch64-linux-gnu-gcc-14 + configure-args: --warn --static + chost: loongarch64-linux-gnu + packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross + cflags: -static + ldflags: -static + + - name: Ubuntu GCC 14 LoongArch64 Compat No Opt + os: ubuntu-latest + compiler: loongarch64-linux-gnu-gcc-14 + configure-args: --warn --static --zlib-compat --without-optimizations --without-new-strategies + chost: loongarch64-linux-gnu + packages: qemu-user gcc-14-loongarch64-linux-gnu g++-14-loongarch64-linux-gnu libc-dev-loong64-cross + cflags: -static + ldflags: -static + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Add ubuntu mirrors + if: runner.os == 'Linux' && matrix.packages + # Github Actions caching proxy is at times unreliable + run: | + echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list + + - name: Install packages (Ubuntu) + if: runner.os == 'Linux' && matrix.packages + run: | + sudo apt-get update + sudo apt-get install -y ${{ matrix.packages }} + + - name: Install packages (macOS) + if: runner.os == 'macOS' + run: brew install ninja ${{ matrix.packages }} + env: + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: Install Emscripten + if: contains(matrix.name, 'WASM32') + uses: mymindstorm/setup-emsdk@v14 + + - name: Generate project files + run: | + mkdir ${{ matrix.build-dir || '.not-used' }} + cd ${{ matrix.build-dir || '.' }} + ${{ matrix.configure-prefix }} ${{ matrix.build-src-dir || '.' }}/configure ${{ matrix.configure-args }} + env: + CC: ${{ matrix.compiler }} + CFLAGS: ${{ matrix.cflags }} + LDFLAGS: ${{ matrix.ldflags }} + CHOST: ${{ matrix.chost }} + EMU_RUN: ${{ matrix.emu-run }} + CI: true + + - name: Compile source code + run: make -j5 + working-directory: ${{ matrix.build-dir }} + + - name: Run test cases + run: make test + working-directory: ${{ matrix.build-dir }} + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: ${{ matrix.name }} (configure) + path: | + **/Makefile + **/configure.log + retention-days: 30 diff --git a/neozip/.github/workflows/fuzz.yml b/neozip/.github/workflows/fuzz.yml new file mode 100644 index 0000000000..9954926722 --- /dev/null +++ b/neozip/.github/workflows/fuzz.yml @@ -0,0 +1,42 @@ +name: OSS-Fuzz +on: + pull_request: + workflow_dispatch: + push: + branches: + - stable + - develop + - pre-release + - '2.*' + tags: + - '*' +concurrency: + # Group by workflow name and branch/PR to only cancel runs on the same branch + group: ${{ github.workflow }}-${{ github.ref }} + # Only cancels in-progress runs if the branch is not 'stable' or 'develop' + cancel-in-progress: ${{ !contains(fromJSON('["refs/heads/stable", "refs/heads/develop"]'), github.ref) }} + +jobs: + fuzzing: + name: Fuzzing + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'zlib-ng' + dry-run: false + + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'zlib-ng' + fuzz-seconds: 600 + dry-run: false + + - name: Upload Crash + uses: actions/upload-artifact@v7 + if: failure() + with: + name: artifacts + path: ./out/artifacts diff --git a/neozip/.github/workflows/libpng.yml b/neozip/.github/workflows/libpng.yml new file mode 100644 index 0000000000..99e690bf76 --- /dev/null +++ b/neozip/.github/workflows/libpng.yml @@ -0,0 +1,54 @@ +name: Libpng +on: [workflow_call, workflow_dispatch] +jobs: + libpng: + name: Ubuntu Clang + runs-on: ubuntu-latest + steps: + - name: Checkout repository (zlib-ng) + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Generate project files (zlib-ng) + run: | + cmake . \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=OFF \ + -DZLIB_COMPAT=ON \ + -DZLIB_ENABLE_TESTS=OFF + env: + CC: clang + CFLAGS: -fPIC + CI: true + + - name: Compile source code (zlib-ng) + run: cmake --build . -j5 --config Release + + - name: Checkout repository (libpng) + uses: actions/checkout@v6 + with: + repository: glennrp/libpng + path: libpng + show-progress: 'false' + + - name: Generate project files (libpng) + run: | + cmake . \ + -DCMAKE_BUILD_TYPE=Release \ + -DPNG_TESTS=ON \ + -DPNG_STATIC=OFF \ + -DZLIB_INCLUDE_DIR=.. \ + -DZLIB_LIBRARY=$PWD/../libz.a + working-directory: libpng + env: + CC: clang + CI: true + + - name: Compile source code (libpng) + run: cmake --build . -j5 --config Release + working-directory: libpng + + - name: Run test cases (libpng) + run: ctest -j5 -C Release --output-on-failure --max-width 120 + working-directory: libpng diff --git a/neozip/.github/workflows/link.yml b/neozip/.github/workflows/link.yml new file mode 100644 index 0000000000..d90571cb97 --- /dev/null +++ b/neozip/.github/workflows/link.yml @@ -0,0 +1,71 @@ +name: Link +on: [workflow_call, workflow_dispatch] +jobs: + zlib: + name: Link zlib + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Checkout zlib repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + repository: madler/zlib + path: zlib + + - name: Generate project files (zlib) + run: cmake -S zlib -B zlib/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + + - name: Compile source code (zlib) + run: cmake --build zlib/build -j5 --config Release + + - name: Generate project files (native) + run: cmake -S . -B native -DZLIB_COMPAT=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_LIBRARIES=../zlib/build/libz.a -DZLIB_INCLUDE_DIR="../zlib/build;../zlib" + + - name: Compile source code (native) + run: cmake --build native -j5 --config Release + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: Link zlib (CMake Logs) + path: | + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log + retention-days: 30 + + zlib-ng-compat: + name: Link zlib-ng compat + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Generate project files (compat) + run: cmake -S . -B compat -DZLIB_COMPAT=ON -DZLIB_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DWITH_MAINTAINER_WARNINGS=ON + + - name: Compile source code (compat) + run: cmake --build compat -j5 --config Release + + - name: Generate project files (native) + run: cmake -S . -B native -DZLIB_COMPAT=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DZLIB_LIBRARIES=../compat/libz.a -DZLIB_INCLUDE_DIR=../compat + + - name: Compile source code (native) + run: cmake --build native -j5 --config Release + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: Link zlib-ng compat (CMake Logs) + path: | + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log + retention-days: 30 diff --git a/neozip/.github/workflows/lint.yml b/neozip/.github/workflows/lint.yml new file mode 100644 index 0000000000..29c15d3519 --- /dev/null +++ b/neozip/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint +on: [pull_request, workflow_dispatch] + +jobs: + lint: + name: Lint + runs-on: ubuntu-slim + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Whitespace errors + run: | + BASE_SHA="${{ github.event.pull_request.base.sha }}" + BASE_SHA="${BASE_SHA:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" + git config core.whitespace blank-at-eol + git diff --color --check "$BASE_SHA" -- './*' ':!*.patch' ':!*.pdf' ':!/test/data/' diff --git a/neozip/.github/workflows/orchestrator.yml b/neozip/.github/workflows/orchestrator.yml new file mode 100644 index 0000000000..fdcc66d317 --- /dev/null +++ b/neozip/.github/workflows/orchestrator.yml @@ -0,0 +1,79 @@ +name: Orchestrator +on: [push, pull_request, workflow_dispatch] +concurrency: + # Group by workflow name and branch/PR to only cancel runs on the same branch + group: ${{ github.workflow }}-${{ github.ref }} + # Only cancels in-progress runs if the branch is not 'stable' or 'develop' + cancel-in-progress: ${{ !contains(fromJSON('["refs/heads/stable", "refs/heads/develop"]'), github.ref) }} + +jobs: + # Workflows not handled here: fuzz, lint, release + + # OSB runs first, the rest won't start unless it succeeds + # This guards against spending a lot of time testing code that is unable to compile. + osb: + name: OSB + uses: ./.github/workflows/osb.yml + secrets: inherit + + analyze: + name: Static Analysis + needs: osb + uses: ./.github/workflows/analyze.yml + secrets: inherit + + cmake: + name: CMake + needs: osb + uses: ./.github/workflows/cmake.yml + secrets: inherit + + codeql: + name: CodeQL + needs: osb + uses: ./.github/workflows/codeql.yml + secrets: inherit + + configure: + name: Configure + needs: osb + uses: ./.github/workflows/configure.yml + secrets: inherit + + libpng: + name: Libpng + needs: osb + uses: ./.github/workflows/libpng.yml + secrets: inherit + + link: + name: Link + needs: osb + uses: ./.github/workflows/link.yml + secrets: inherit + + pigz: + name: Pigz + needs: osb + uses: ./.github/workflows/pigz.yml + secrets: inherit + + pkgcheck: + name: Package Check + needs: osb + uses: ./.github/workflows/pkgcheck.yml + secrets: inherit + + # This job only starts if both cmake and pigz workflows above succeed + final-upload: + needs: [cmake, pigz] + runs-on: ubuntu-slim + if: success() + steps: + - name: Coveralls - Finalize + uses: coverallsapp/github-action@v2 + if: (env.COVERALLS_REPO_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + with: + parallel-finished: true + env: + COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" diff --git a/neozip/.github/workflows/osb.yml b/neozip/.github/workflows/osb.yml new file mode 100644 index 0000000000..8330211cce --- /dev/null +++ b/neozip/.github/workflows/osb.yml @@ -0,0 +1,69 @@ +name: OSB +on: [workflow_call, workflow_dispatch] +jobs: + cmake: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + timeout-minutes: 80 + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC OSB + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + build-dir: ../build + build-src-dir: ../zlib-ng + cmake-args: -DWITH_BENCHMARKS=ON + + - name: Ubuntu GCC OSB add_subdirectory + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + build-dir: ../build + build-src-dir: ../zlib-ng/test/add-subdirectory-project + cmake-args: -DWITH_BENCHMARKS=ON + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: false + + - name: Make source tree read-only + shell: bash + run: chmod -R a-w . + + - name: Generate project files + shell: bash + run: | + cmake -S ${{ matrix.build-src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} \ + ${{ matrix.cmake-args }} \ + -DWITH_MAINTAINER_WARNINGS=ON + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + CI: true + + - name: Compile source code + run: cmake --build ${{ matrix.build-dir || '.' }} --verbose -j5 + + - name: Run test cases + run: ctest --verbose -C Release --output-on-failure --max-width 120 -j 5 + working-directory: ${{ matrix.build-dir || '.' }} + + - name: Make source tree writable + shell: bash + run: chmod -R +w . + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: ${{ matrix.name }} + path: | + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log + **/Testing/Temporary/* + retention-days: 30 diff --git a/neozip/.github/workflows/pigz.yml b/neozip/.github/workflows/pigz.yml new file mode 100644 index 0000000000..9cc5ff3e55 --- /dev/null +++ b/neozip/.github/workflows/pigz.yml @@ -0,0 +1,135 @@ +name: Pigz +on: [workflow_call, workflow_dispatch] +jobs: + pigz: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC + os: ubuntu-latest + compiler: gcc + coverage: ubuntu_gcc_pigz + + - name: Ubuntu GCC Symbol Prefix + os: ubuntu-latest + compiler: gcc + coverage: ubuntu_gcc_pigz_prefix + cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_ + + - name: Ubuntu Clang + os: ubuntu-latest + compiler: clang + packages: llvm-15 llvm-15-tools + gcov-exec: llvm-cov-15 gcov + coverage: ubuntu_clang_pigz + + - name: Ubuntu Clang No Optim + os: ubuntu-latest + compiler: clang + packages: llvm-15 llvm-15-tools + gcov-exec: llvm-cov-15 gcov + coverage: ubuntu_clang_pigz_no_optim + cmake-args: -DWITH_OPTIM=OFF + + # Use v2.6 due to NOTHREADS bug https://github.com/madler/pigz/issues/97 + - name: Ubuntu Clang No Threads + os: ubuntu-latest + compiler: clang + packages: llvm-15 llvm-15-tools + gcov-exec: llvm-cov-15 gcov + coverage: ubuntu_clang_pigz_no_threads + cmake-args: -DWITH_THREADS=OFF -DPIGZ_VERSION=v2.6 + + - name: Ubuntu GCC AARCH64 + os: ubuntu-24.04-arm + coverage: ubuntu_gcc_pigz_aarch64 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Checkout test corpora + uses: actions/checkout@v6 + with: + repository: zlib-ng/corpora + path: test/data/corpora + show-progress: 'false' + + - name: Add ubuntu mirrors + if: runner.os == 'Linux' && matrix.packages + # Github Actions caching proxy is at times unreliable + run: | + echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list + + - name: Install packages (Ubuntu) + if: runner.os == 'Linux' && matrix.packages + run: | + sudo apt-get update + sudo apt-get install -y ${{ matrix.packages }} + + - name: Generate project files + run: | + cmake ${{ matrix.cmake-args }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} \ + -DBUILD_SHARED_LIBS=OFF \ + -DZLIB_ROOT=../.. \ + -DWITH_CODE_COVERAGE=ON \ + -DWITH_MAINTAINER_WARNINGS=ON + working-directory: test/pigz + env: + CC: ${{ matrix.compiler }} + CFLAGS: ${{ matrix.cflags }} + LDFLAGS: ${{ matrix.ldflags }} + CI: true + + - name: Compile source code + run: cmake --build . -j5 --config ${{ matrix.build-config || 'Release' }} + working-directory: test/pigz + + - name: Run test cases + run: ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallel-jobs || '5' }} + working-directory: test/pigz + + - name: Generate coverage report + if: matrix.coverage + run: | + python3 -u -m pip install gcovr + python3 -m gcovr -j 5 --gcov-ignore-parse-errors --verbose \ + --exclude '(.*/|^)(_deps|benchmarks)/.*' \ + --exclude-unreachable-branches \ + --merge-mode-functions separate \ + --merge-lines \ + --gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \ + --root . \ + --xml --output ${{ matrix.coverage }}.xml + + - name: Upload job coverage report to coveralls + uses: coverallsapp/github-action@v2 + env: + COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" + if: | + matrix.codecov + && (env.COVERALLS_REPO_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') + with: + file: ${{ matrix.codecov }}.xml + flag-name: "${{ matrix.name }}-${{ github.event_name }}" + parallel: true + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: ${{ matrix.name }} (cmake) + path: | + **/CMakeFiles/CMakeOutput.log + **/CMakeFiles/CMakeError.log + **/Testing/Temporary/* + ${{ matrix.coverage }}.xml + retention-days: 30 diff --git a/neozip/.github/workflows/pkgcheck.yml b/neozip/.github/workflows/pkgcheck.yml new file mode 100644 index 0000000000..8c8d17ea3c --- /dev/null +++ b/neozip/.github/workflows/pkgcheck.yml @@ -0,0 +1,189 @@ +name: Package Check +on: [workflow_call, workflow_dispatch] +jobs: + pkgcheck: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + + - name: Ubuntu GCC -m32 + os: ubuntu-latest + compiler: gcc + cxx-compiler: g++ + packages: gcc-multilib g++-multilib + cmake-args: -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 + cflags: -m32 + cxxflags: -m32 + ldflags: -m32 + + - name: Ubuntu GCC ARM HF + os: ubuntu-24.04-arm + chost: arm-linux-gnueabihf + compiler: arm-linux-gnueabihf-gcc + cxx-compiler: arm-linux-gnueabihf-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake + packages: qemu-user gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross + + - name: Ubuntu GCC AARCH64 + os: ubuntu-24.04-arm + compiler: gcc + cxx-compiler: g++ + + - name: Ubuntu GCC MIPS + os: ubuntu-latest + chost: mips-linux-gnu + compiler: mips-linux-gnu-gcc + cxx-compiler: mips-linux-gnu-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips.cmake + packages: qemu-user gcc-mips-linux-gnu g++-mips-linux-gnu libc6-dev-mips-cross + + - name: Ubuntu GCC MIPS64 + os: ubuntu-latest + chost: mips64-linux-gnuabi64 + compiler: mips64-linux-gnuabi64-gcc + cxx-compiler: mips64-linux-gnuabi64-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-mips64.cmake + packages: qemu-user gcc-mips64-linux-gnuabi64 g++-mips64-linux-gnuabi64 libc6-dev-mips64-cross + + - name: Ubuntu GCC PPC + os: ubuntu-latest + chost: powerpc-linux-gnu + compiler: powerpc-linux-gnu-gcc + cxx-compiler: powerpc-linux-gnu-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc.cmake + packages: qemu-user gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-powerpc-cross + + - name: Ubuntu GCC PPC64LE + os: ubuntu-latest + chost: powerpc64le-linux-gnu + compiler: powerpc64le-linux-gnu-gcc + cxx-compiler: powerpc64le-linux-gnu-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-powerpc64le.cmake + packages: qemu-user gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu libc6-dev-ppc64el-cross + + - name: Ubuntu GCC RISC-V + os: ubuntu-latest + chost: riscv64-linux-gnu + compiler: riscv64-linux-gnu-gcc + cxx-compiler: riscv64-linux-gnu-g++ + cmake-args: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-riscv.cmake + packages: qemu-user gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross + + - name: macOS Clang + os: macOS-latest + compiler: clang + cxx-compiler: clang++ + + - name: macOS Clang Symbol Prefix + os: macOS-latest + compiler: clang + cxx-compiler: clang++ + cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_ + configure-args: --sprefix=zTest_ + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Add ubuntu mirrors + if: runner.os == 'Linux' && matrix.packages + run: | + # Github Actions caching proxy is at times unreliable + echo -e 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt + sudo sed -i 's#http://azure.archive.ubuntu.com/ubuntu/#mirror+file:/etc/apt/mirrors.txt#' /etc/apt/sources.list + + - name: Install packages (Ubuntu) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends ${{ matrix.packages }} \ + abigail-tools \ + diffoscope \ + ninja-build + + - name: Install packages (macOS) + if: runner.os == 'macOS' + run: brew install ninja diffoscope ${{ matrix.packages }} + env: + HOMEBREW_NO_INSTALL_CLEANUP: 1 + + - name: Select Xcode version (macOS) + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '16.4' + + - name: Compare builds + run: sh test/pkgcheck.sh + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + CFLAGS: ${{ matrix.cflags }} + CXXFLAGS: ${{ matrix.cxxflags }} + CHOST: ${{ matrix.chost }} + CMAKE_ARGS: ${{ matrix.cmake-args }} -DWITH_ALL_FALLBACKS=ON + CONFIGURE_ARGS: ${{ matrix.configure-args }} + LDFLAGS: ${{ matrix.ldflags }} + + - name: Compare builds (compat) + run: sh test/pkgcheck.sh --zlib-compat + env: + CC: ${{ matrix.compiler }} + CFLAGS: ${{ matrix.cflags }} + CHOST: ${{ matrix.chost }} + CMAKE_ARGS: ${{ matrix.cmake-args }} -DWITH_ALL_FALLBACKS=ON + CONFIGURE_ARGS: ${{ matrix.configure-args }} + LDFLAGS: ${{ matrix.ldflags }} + + - name: Check ABI + # macOS runner does not contain abigail + if: runner.os != 'macOS' + run: sh test/abicheck.sh --refresh-if + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + CFLAGS: ${{ matrix.cflags }} + CXXFLAGS: ${{ matrix.cxxflags }} + CHOST: ${{ matrix.chost }} + CMAKE_ARGS: ${{ matrix.cmake-args }} + CONFIGURE_ARGS: ${{ matrix.configure-args }} + LDFLAGS: ${{ matrix.ldflags }} + + - name: Check ABI (compat) + # macOS runner does not contain abigail + if: runner.os != 'macOS' + run: sh test/abicheck.sh --zlib-compat --refresh-if + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.cxx-compiler }} + CFLAGS: ${{ matrix.cflags }} + CXXFLAGS: ${{ matrix.cxxflags }} + CHOST: ${{ matrix.chost }} + CMAKE_ARGS: ${{ matrix.cmake-args }} + CONFIGURE_ARGS: ${{ matrix.configure-args }} + LDFLAGS: ${{ matrix.ldflags }} + + - name: Upload build errors + uses: actions/upload-artifact@v7 + if: failure() + with: + name: ${{ matrix.name }} + path: | + **/*.abi + btmp1/configure.log + btmp1/CMakeFiles/CMakeOutput.log + btmp1/CMakeFiles/CMakeError.log + btmp2/configure.log + btmp2/CMakeFiles/CMakeOutput.log + btmp2/CMakeFiles/CMakeError.log + retention-days: 30 diff --git a/neozip/.github/workflows/release.yml b/neozip/.github/workflows/release.yml new file mode 100644 index 0000000000..5fa47eb834 --- /dev/null +++ b/neozip/.github/workflows/release.yml @@ -0,0 +1,123 @@ +name: Release +on: + push: + tags: + - '*' +jobs: + release: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Windows MSVC Win32 + os: windows-latest + compiler: cl + cmake-args: -A Win32 + deploy-name: win-x86 + + - name: Windows MSVC Win32 Compat + os: windows-latest + compiler: cl + cmake-args: -A Win32 -DZLIB_COMPAT=ON + deploy-name: win-x86-compat + + - name: Windows MSVC Win64 + os: windows-latest + compiler: cl + cmake-args: -A x64 + deploy-name: win-x86-64 + + - name: Windows MSVC Win64 Compat + os: windows-latest + compiler: cl + cmake-args: -A x64 -DZLIB_COMPAT=ON + deploy-name: win-x86-64-compat + + - name: Windows MSVC ARM + os: windows-latest + compiler: cl + cmake-args: -A ARM,version=10.0.22621.0 + deploy-name: win-arm + + - name: Windows MSVC ARM Compat + os: windows-latest + compiler: cl + cmake-args: -A ARM,version=10.0.22621.0 -DZLIB_COMPAT=ON + deploy-name: win-arm-compat + + - name: Windows MSVC ARM64 + os: windows-latest + compiler: cl + cmake-args: -A ARM64 + deploy-name: win-arm64 + + - name: Windows MSVC ARM64 Compat + os: windows-latest + compiler: cl + cmake-args: -A ARM64 -DZLIB_COMPAT=ON + deploy-name: win-arm64-compat + + - name: Windows MSVC ARM64EC + os: windows-latest + compiler: cl + cmake-args: -A ARM64EC + deploy-name: win-arm64ec + + - name: Windows MSVC ARM64EC Compat + os: windows-latest + compiler: cl + cmake-args: -A ARM64EC -DZLIB_COMPAT=ON + deploy-name: win-arm64ec-compat + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + show-progress: 'false' + + - name: Set environment variables + shell: bash + run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Install Windows 11 SDK (ARM) + if: matrix.name == 'Windows MSVC ARM' || matrix.name == 'Windows MSVC ARM Compat' + run: | + # Windows 11 SDK (10.0.22621.2428) + # https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/index-legacy + Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=2250105 -OutFile sdksetup.exe -UseBasicParsing + Unblock-File sdksetup.exe + Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/ceip off" + + - name: Generate project files + shell: bash + run: | + cmake . ${{ matrix.cmake-args }} \ + -DCMAKE_BUILD_TYPE=Release \ + -DZLIB_ENABLE_TESTS=ON \ + -DCMAKE_INSTALL_PREFIX=out \ + -DINSTALL_UTILS=ON + env: + CC: ${{ matrix.compiler }} + CI: true + + - name: Compile source code + run: cmake --build . -j5 --config Release --target install + + - name: Package release (Windows) + if: runner.os == 'Windows' + run: 7z a -tzip ../zlib-ng-${{ matrix.deploy-name }}.zip bin include lib ../LICENSE.md ../PORTING.md ../README.md + working-directory: out + + - name: Upload release (Windows) + uses: svenstaro/upload-release-action@v2 + if: runner.os == 'Windows' + with: + asset_name: zlib-ng-${{ matrix.deploy-name }}.zip + file: zlib-ng-${{ matrix.deploy-name }}.zip + tag: ${{env.tag}} + repo_token: ${{ secrets.GITHUB_TOKEN }} + overwrite: true + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
