Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
40416c3
Fix decompress a zip multi-volume archive file without filename exten…
liuyipingali Sep 12, 2024
9aeff7b
Fixed whitespace in mz_stream_split_open_disk.
nmoinvaz Oct 22, 2024
95fdb49
Do not use REQUIRED with find_dependency
dg0yt Jul 5, 2024
b2691a0
Added MZ_TARGET_APPSTORE to hide GSM private api on macOS
Coeur Oct 22, 2024
6946ba6
Fixed disk spanning failures due to changes in #799.
nmoinvaz Oct 30, 2024
8950c24
Group compatibilities per origin
Coeur Oct 30, 2024
0bf8db3
Fixed GCC warnings about path_length reuse in strncat.
nmoinvaz Oct 30, 2024
cc14474
Move mz_compat to compat folder.
nmoinvaz Oct 30, 2024
7df56f7
Split compat layer into different source files #806
nmoinvaz Oct 30, 2024
8339456
Variable 'total_in' set but not used
Coeur Oct 31, 2024
20c6f56
Implicit conversion loses integer precision: 'unsigned long' to 'int3…
Coeur Oct 31, 2024
c460967
Value stored to 'err' is never read
Coeur Nov 1, 2024
39255ca
The value is never actually read from 'zlib'
Coeur Nov 1, 2024
483950d
Adopting a clang-format based on Google style
Coeur Nov 1, 2024
2c51fa7
Clang-format style changes.
nmoinvaz Nov 1, 2024
53e6382
fix incorrect dos date conversion
Coeur Nov 10, 2024
91112ba
Expose zlib constants for backwards compat
Coeur Nov 1, 2024
9118292
avoid redefining already defined type
Coeur Nov 1, 2024
3438b88
remove superfluous redefines
Coeur Nov 1, 2024
6a1a1ee
fix Windows build
Coeur Nov 1, 2024
5221967
improve logic on variants of ZLIB_H
Coeur Nov 1, 2024
3bced61
Move zlib include to zip/unzip headers like org minizip.
nmoinvaz Nov 11, 2024
34111e2
FIx typo in `mz_zip_file.md`
yaslab Nov 9, 2024
32b6697
missing mz_dos_date defines in unzip.h
Coeur Nov 11, 2024
00d695d
align ZEXPORT definitions
Coeur Nov 11, 2024
d7f5fdd
fix and improve fuzzers
tyler92 Nov 14, 2024
6d45beb
ignore number_entry_cd when recover
Coeur Nov 13, 2024
c808a65
Bump codecov/codecov-action from 4 to 5
dependabot[bot] Dec 1, 2024
cf5404b
fix: don't replace slashes on UNIX
Coeur Nov 23, 2024
4a1d10f
Fix Windows Alternate Data Stream (ADS) Support
gabriellandau Jan 7, 2025
888d471
Add gtest validating `mz_os_get_file_date` works on ADS
gabriellandau Jan 7, 2025
55db144
Version 4.0.8.
nmoinvaz Jan 8, 2025
dd91a4d
Remove excess checks before free()
GermanAizek Feb 28, 2025
e6eeb4e
Align structures for 64-bit platforms (stream_split, mz_opt, crypt_sh…
GermanAizek Mar 12, 2025
5e99d52
Consider passed codepage on listing and extraction callback
tbeu Feb 18, 2025
1529686
Apply Clang format
tbeu Feb 18, 2025
4f571d6
Add lint workflow for clang-format
nmoinvaz Mar 25, 2025
c9eff8d
crypt.h: Remove register keyword
Apr 2, 2025
581a403
Fix default branch name in lint workflow.
nmoinvaz Apr 2, 2025
68dc2f3
Pre-calc length destination directory before while loop
GermanAizek Feb 28, 2025
aa33f4c
Don't use Z_ERRNO if zlib not included. #852
nmoinvaz Apr 5, 2025
95ba7ab
Version 4.0.9.
nmoinvaz Apr 5, 2025
b83e9ef
gitgnore build folders
Coeur Apr 13, 2025
c7b6cb0
fix: unzipping with backslashes in the name on UNIX
Coeur Nov 24, 2024
1eb579d
updating test expectations
Coeur Apr 13, 2025
f894149
Adding MZ_PRESERVE_NATIVE_STRUCTURE to control the behavior.
Coeur Apr 13, 2025
e247d31
cleanup pathwfs
Coeur Apr 15, 2025
dabe963
Make pattern in mz_zip_reader dynamically assigned
DreamHelium Apr 9, 2025
e090f46
add space and move brace
DreamHelium Apr 15, 2025
c7e211e
Support star in filename
Coeur Apr 30, 2025
c18b5bf
updating github actions for ubuntu-22.04
Coeur Apr 30, 2025
10646f0
fix: unzipping with backslash at the end of the filename
Coeur May 1, 2025
4b77011
Support any character encoding
Coeur May 1, 2025
4e88434
free up writer memory when failing to open archive for reading
Coeur May 4, 2025
e9ab178
Remove old ubuntu CI run
nmoinvaz May 5, 2025
b4ff924
fix copy encrypted file info
Coeur May 5, 2025
f3ed731
Version 4.0.10.
nmoinvaz May 5, 2025
d265da0
Apply Clang format
tbeu May 5, 2025
799086d
align bzip and lzma streams for 64-bit platforms
GermanAizek May 20, 2025
378a4eb
Revert: Make `pattern` in `mz_zip_reader` dynamically assigned (#856)
Coeur May 9, 2025
b056834
Mark handle as unused.
kalibera May 23, 2025
57cc292
doc: compression -> decompression
Coeur May 25, 2025
227f2d3
Updage usage of Buffered Stream
May 26, 2025
c665368
zstd: add MZ_STREAM_PROP_COMPRESS_THREADS
rocket-pharris Jun 16, 2025
4f46a3d
fix stack overrun in mz_os_utf8_string_create
rocket-pharris Jun 16, 2025
152e746
harden mz_zip_writer_add_file against link following
rocket-pharris Jun 16, 2025
20aa898
refactor: passing reader, writer, zip instead of handle
Coeur May 9, 2025
def371a
zip_rw: validate the handle in each getter/setter
rocket-pharris Jun 17, 2025
897a68a
Fix transitive finding of zlib-ng
sgoth May 26, 2025
27d9a0c
Add cmake control to select zlib flavor
sgoth May 26, 2025
0969e94
Document MZ_ZLIB_FLAVOR
sgoth Jun 19, 2025
636cba8
Bump svenstaro/upload-release-action from 2.9.0 to 2.11.1
dependabot[bot] Jul 1, 2025
d214437
Use unsigned int instead of uint32_t in crypt.h for max compat. #897
nmoinvaz Jul 26, 2025
61121ab
Bump svenstaro/upload-release-action from 2.11.1 to 2.11.2
dependabot[bot] Aug 1, 2025
8183c02
Bump actions/checkout from 4 to 5
dependabot[bot] Sep 1, 2025
5d6cbe9
fix missing const at r/o buffers
sergio-nsk Sep 11, 2025
3ad5bb4
fix improper mz_stream mode set in mz_zip_reader_entry_save_buffer()
sergio-nsk Sep 11, 2025
45610c1
Drop PKWARE's APPNOTE
bgermann Sep 18, 2025
a421f7f
Drop WinZip's AES Encryption Information
bgermann Sep 18, 2025
71ff332
Drop "Attacking and Repairing the WinZip Encryption Scheme"
bgermann Sep 18, 2025
7c1bb56
Bump actions/setup-python from 5 to 6
dependabot[bot] Oct 1, 2025
1867916
Removing superfluous const
Coeur Oct 5, 2025
9a2a6be
`mz_stream_zstd_set_prop_int64`: Implicit conversion loses integer pr…
Coeur Oct 30, 2025
f890d80
Fix allocating negative size
Coeur Oct 30, 2025
549d4c2
Bump actions/upload-artifact from 4 to 5
dependabot[bot] Nov 1, 2025
362b091
Bump github/codeql-action from 3 to 4
dependabot[bot] Nov 1, 2025
6e5e01a
Bump GoogleTest to 1.16
Coeur Nov 7, 2025
73d09cb
Avoid ruby codeql failure
Coeur Nov 8, 2025
05ba698
fix #915: headers should not include there dependencies
bebuch Nov 7, 2025
31e2b51
Remove `build-src-dir`
Coeur Nov 8, 2025
e2e889b
Compatible with systems without symbolic links
noword Nov 17, 2025
f79db2c
Bump svenstaro/upload-release-action from 2.11.2 to 2.11.3
dependabot[bot] Dec 1, 2025
bf92612
Bump actions/checkout from 5 to 6
dependabot[bot] Dec 1, 2025
f1a1d00
Fix modified_date when zipping
Coeur Nov 28, 2025
ed1522e
Bump actions/upload-artifact from 5 to 6
dependabot[bot] Jan 1, 2026
fb08501
Add workflow_dispatch to all workflows
pmqs Jan 19, 2026
8a4c016
Update FindZLIB-NG.cmake
emrecanbulut Sep 1, 2025
3e5213b
Finding the correct library based on dynamic or static choice
emrecanbulut Jan 21, 2026
bb282ac
Fixed arbitrary file write vulnerability via symlinks. #936
nmoinvaz Jan 21, 2026
5a3c62c
Fix arbitrary file write vulnerability via temp file symlink #938
nmoinvaz Jan 21, 2026
cf4b58e
Version 4.1.0.
nmoinvaz Jan 21, 2026
185667e
Move symlink safety check before overwrite callback in zip extract #945
nmoinvaz Jan 27, 2026
0fa77a3
Resolve alias targets to their real targets for installation
nmoinvaz Jan 27, 2026
9963dd3
Add buffer overflow check in mz_os_read_symlink function #944
nmoinvaz Jan 27, 2026
32747dc
Use fixed buffer size for symlink target instead of path length
nmoinvaz Jan 27, 2026
0574b3b
Allocate symlink buffers on first use
nmoinvaz Jan 27, 2026
c9cb748
Fix #941: fix undeclared identifier error of S_IWUSR
apocelipes Jan 25, 2026
92eecea
Replace deprecated FetchContent_GetProperties with FetchContent_MakeA…
pmqs Jan 28, 2026
5880418
Add support for PPMd compression
pmqs Jan 13, 2026
aa00b1d
Add a PPMd dependabot workflow
pmqs Jan 31, 2026
020b11a
mz_strm_ppmd.c reader issue: it can't detect EOF (#953)
pmqs Feb 2, 2026
12cd149
Add PPMd & Zstd zip files to the fuzz corpus (#954)
pmqs Feb 2, 2026
333bb8e
Document that mz_zip_tm_to_time_t requires a year-1900 indexed time s…
Coeur Feb 3, 2026
1040d35
build: avoid MIN macro for Windows (#949)
Coeur Feb 3, 2026
c8c4942
Add TearDown cleanup for encrypt test temp files
nmoinvaz Feb 3, 2026
41ad65f
Add TearDown cleanup for compat test temp files
nmoinvaz Feb 3, 2026
7ef1662
Update markdown files to reference PPMD compression (#958)
pmqs Feb 4, 2026
b60d15c
remove calls to add_subdirectory for lzma & zlib (#959)
pmqs Feb 9, 2026
9c32106
Fix for older versions of CMake without FetchContent EXCLUDE_FROM_ALL
nmoinvaz Feb 9, 2026
db034d5
Remove redundant MZ_ZLIB_FLAVORS variable and validation check
nmoinvaz Feb 18, 2026
9975579
Sync sanitizer detection CMake with zlib-ng.
nmoinvaz Feb 18, 2026
b6bf991
Add cmake subdirectory support to clone_repo macro for zstd.
nmoinvaz Mar 3, 2026
2dcae48
Add MOVEFILE_COPY_ALLOWED flag to MoveFileExW to allow moving across …
pmqs Mar 11, 2026
d2d6b76
Refactor file rename error handling when backup fails
pmqs Mar 11, 2026
ea5c15c
update to use ppmd from 7zip 26.00
pmqs Mar 11, 2026
3c0d277
Bump actions/upload-artifact from 6 to 7
dependabot[bot] Mar 11, 2026
66c2c59
Bump svenstaro/upload-release-action from 2.11.3 to 2.11.4
dependabot[bot] Mar 11, 2026
335aa00
Set default value for MZ_SANITIZER to OFF in README.md
pmqs Mar 10, 2026
811d287
Replace ZLIB_ENABLE_TESTS with BUILD_TESTING
pmqs Mar 10, 2026
af59994
Fix integer overflow in split stream write for disk sizes > 2GB
nmoinvaz Mar 13, 2026
27cdb50
Use python from setup-python action.
nmoinvaz Mar 19, 2026
089872d
Bump svenstaro/upload-release-action from 2.11.4 to 2.11.5
dependabot[bot] Apr 1, 2026
25db93f
Bump codecov/codecov-action from 5 to 6
dependabot[bot] Apr 1, 2026
a4fc642
Restore ability to prefer OpenSSL over BCrypt on Windows
solbjorn Apr 7, 2026
d6f4bf8
Fix warning use of `mktemp` is dangerous. Fixes #956 (#957)
pmqs Apr 9, 2026
bf4c563
improve: support for more platforms (#977)
sergio-nsk Apr 18, 2026
2f074dc
cmake: improve: mz.h, mz_os.h are public API, shouldn't rely on user …
sergio-nsk Apr 21, 2026
223a3d6
Fix two bugs causing premature exiting the PPMd decompression (#976)
solbjorn Apr 23, 2026
3e10f4d
Harden the cmake Address Sanitizer detection code. (#960)
pmqs Apr 23, 2026
3ffb8de
Disable OpenSSL to avoid libcrypto false positives for MSAN
nmoinvaz Apr 23, 2026
4d9088d
Force-fetch compression libraries so they are MSAN instrumented
nmoinvaz Apr 23, 2026
ced107c
Implement MSAN_OPTIONS env variable in build workflow.
nmoinvaz Apr 23, 2026
ad05efe
Upload all coverage reports at once
nmoinvaz Apr 23, 2026
c37440f
Build libc++ with MSAN instrumentation for gtest_minizip
nmoinvaz Apr 23, 2026
37adbba
Version 4.1.1.
nmoinvaz Apr 23, 2026
423b644
cmake: fix: mz_config.h was missing in install target (#980)
sergio-nsk Apr 25, 2026
84f3b20
cmake: generate mz_config.h in build directory
nmoinvaz Apr 25, 2026
96f1134
cmake: remove unnecessary include dirs for test binaries
nmoinvaz Apr 25, 2026
597ee06
cmake: fix formatting before HOMEPAGE_URL
nmoinvaz Apr 25, 2026
322c161
cmake: don't check ZLIB_COMPAT before it is set in MZ_FETCH_LIBS
nmoinvaz Apr 25, 2026
31049d4
cmake: fix comment for check_function_exists calls
nmoinvaz Apr 25, 2026
0a7ddd0
cmake: use target_link_options instead of set_target_properties
nmoinvaz Apr 25, 2026
c7c6ea7
cmake: remove duplicate source include dir
nmoinvaz Apr 25, 2026
288b7f1
cmake: install crypt.h if using compatability mode #862
AndrewAtAvenza Apr 25, 2026
9a92170
cmake: rename target files to avoid overwrite of PACKAGE_VERSION
bebuch Oct 29, 2025
9826cbd
Version 4.1.2.
nmoinvaz Apr 25, 2026
a3c6e8c
cmake: use imported targets for compression and crypto backends
nmoinvaz Apr 25, 2026
1d5bc8d
cmake: use -framework linker flags for CoreFoundation and Security
nmoinvaz Apr 25, 2026
6a99a95
cmake: link backend deps as PRIVATE and drop target_link_directories
nmoinvaz Apr 25, 2026
6e97fbe
cmake: only register found packages in MINIZIP_DEP_PKG
nmoinvaz Apr 25, 2026
8aabaf2
cmake: link zlib PUBLIC when MZ_COMPAT exposes it in headers
nmoinvaz Apr 25, 2026
74609ad
cmake: delegate OpenSSL pkg-config naming to Requires.private
nmoinvaz Apr 25, 2026
434593c
cmake: remove bundled FindZLIB-NG module
nmoinvaz Apr 25, 2026
c6fd0d7
cmake: skip find_dependency for PRIVATE deps when building shared
nmoinvaz Apr 25, 2026
b3bb871
cmake: clean up and tighten comments
nmoinvaz Apr 25, 2026
8ec500f
cmake: rename MINIZIP_PUBLIC_LIB variable
nmoinvaz Apr 25, 2026
483f056
mz_os: skip symlink check at or above destination dir
nmoinvaz Apr 25, 2026
ece5b06
test: skip AES-GCM test when build doesn't support it
nmoinvaz Apr 25, 2026
3f23ed7
minizip: place erase temp on same filesystem when TMPDIR differs
nmoinvaz Apr 25, 2026
6b9defc
mz_os: split file and link attribute getters (#797)
nmoinvaz Apr 27, 2026
a6300c3
compat: add unzGetCurrentFileZStreamPos64 (#848)
nmoinvaz Apr 27, 2026
ea91a3c
Version 4.2.0.
nmoinvaz Apr 27, 2026
d195f37
cmake: pick zstd and zlib-ng targets per BUILD_SHARED_LIBS
nmoinvaz Apr 27, 2026
26b4619
Version 4.2.1.
nmoinvaz Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
BasedOnStyle: Google

AccessModifierOffset: -2
AlignArrayOfStructures: Right
AlignConsecutiveBitFields: AcrossEmptyLines
AlignConsecutiveMacros: AcrossEmptyLines
AlignEscapedNewlines: Right
AlignOperands: DontAlign
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
ColumnLimit: 120
DerivePointerAlignment: false
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 4
InsertNewlineAtEOF: true
PointerAlignment: Right
PPIndentWidth: 2
SortIncludes: Never
177 changes: 136 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name: Build
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ci:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 20 GCC
os: ubuntu-20.04
compiler: gcc
cxx-compiler: g++

- name: Ubuntu GCC ASAN
os: ubuntu-latest
compiler: gcc
Expand All @@ -30,27 +25,34 @@ jobs:
cmake-args: -D MZ_SANITIZER=Undefined
codecov: ubuntu_gcc_undefined

- name: Ubuntu GCC MSAN
- name: Ubuntu Clang MSAN
os: ubuntu-latest
compiler: gcc
cxx-compiler: g++
cmake-args: -D MZ_SANITIZER=Memory
codecov: ubuntu_gcc_msan
compiler: clang-20
cxx-compiler: clang++-20
# Disable OpenSSL since it is not built with MSAN
# Fetch third-party libraries and don't use system libraries so they can be intrumented
cmake-args: -GNinja -DMZ_SANITIZER=Memory -DMZ_OPENSSL=OFF -DMZ_FORCE_FETCH_LIBS=ON
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

# No code coverage on release builds
- name: Ubuntu 20 Clang
os: ubuntu-20.04
- name: Ubuntu 22 Clang
os: ubuntu-22.04
compiler: clang
cxx-compiler: clang++
deploy: true
deploy-name: linux

- name: Ubuntu 20 Clang 6.0
os: ubuntu-20.04
compiler: clang-6.0
cxx-compiler: clang++-6.0
version: "6.0"
packages: llvm-6.0 clang-6.0
- name: Ubuntu 22 Clang 11
os: ubuntu-22.04
compiler: clang-11
cxx-compiler: clang++-11
version: "11"
packages: llvm-11 clang-11

- name: Ubuntu GCC
os: ubuntu-latest
Expand All @@ -59,12 +61,12 @@ jobs:
cmake-args: -D MZ_CODE_COVERAGE=ON
codecov: ubuntu_gcc

# out-of-source build
- name: Ubuntu GCC OSB
os: ubuntu-latest
compiler: gcc
cxx-compiler: g++
build-dir: ../build
build-src-dir: ../minizip-ng

- name: Ubuntu Clang
os: ubuntu-latest
Expand Down Expand Up @@ -111,6 +113,15 @@ jobs:
packages: clang-14 llvm-14
gcov-exec: llvm-cov-14 gcov

- name: Ubuntu Clang No Ppmd
os: ubuntu-latest
compiler: clang-14
cxx-compiler: clang++-14
cmake-args: -D MZ_CODE_COVERAGE=ON -D MZ_PPMD=OFF
codecov: ubuntu_clang_no_ppmd
packages: clang-14 llvm-14
gcov-exec: llvm-cov-14 gcov

- name: Ubuntu Clang No Pkcrypt
os: ubuntu-latest
compiler: clang-14
Expand Down Expand Up @@ -214,7 +225,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install packages (macOS)
if: runner.os == 'macOS'
Expand All @@ -233,10 +244,59 @@ jobs:
choco uninstall --no-progress strawberryperl
choco install ninja --no-progress

- 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: |
# Sparse-checkout only the folders we need
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
run: |
cmake -S ${{ matrix.build-src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} \
cmake -S . -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} \
-D MZ_BUILD_TESTS=ON \
-D MZ_BUILD_UNIT_TESTS=ON \
-D BUILD_SHARED_LIBS=OFF \
Expand All @@ -253,9 +313,11 @@ jobs:
- name: Run test cases
run: ctest --output-on-failure -C ${{ matrix.build-config || 'Release' }}
working-directory: ${{ matrix.build-dir }}

env:
MSAN_OPTIONS: ${{ matrix.msan-options || 'verbosity=0' }}

- name: Setup python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
if: always() && matrix.codecov
with:
python-version: '3.x'
Expand All @@ -264,35 +326,31 @@ jobs:
shell: bash
if: always() && matrix.codecov
run: |
python3 -u -m pip install gcovr
python3 -m gcovr \
pip install gcovr
python -m gcovr \
--exclude-unreachable-branches \
--gcov-ignore-parse-errors \
--gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \
--root ${{ matrix.build-src-dir || '.' }} \
--root . \
--xml \
--output coverage.xml \
--output coverage-${{ matrix.codecov }}.xml \
--verbose

- name: Upload coverage report
uses: codecov/codecov-action@v4
if: always() && matrix.codecov && env.CODECOV_TOKEN != ''
uses: actions/upload-artifact@v6
if: always() && matrix.codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.codecov }}
name: ${{ matrix.name }}
directory: ${{ matrix.build-src-dir || '.' }}
verbose: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
name: Coverage Report - ${{ matrix.name }}
path: coverage-${{ matrix.codecov }}.xml
if-no-files-found: ignore
retention-days: 2

- name: Package release (Ubuntu/macOS)
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.deploy && startsWith(github.ref, 'refs/tags/')
run: ls -R mini*zip | tar -czvf minizip-ng-${{ matrix.deploy-name }}.tar.gz -T -

- name: Upload release (Ubuntu/macOS)
uses: svenstaro/upload-release-action@2.9.0
uses: svenstaro/upload-release-action@2.11.5
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.deploy && startsWith(github.ref, 'refs/tags/') && env.GITHUB_TOKEN != ''
with:
asset_name: minizip-ng-${{ matrix.deploy-name }}.tar.gz
Expand All @@ -308,7 +366,7 @@ jobs:
run: 7z a -tzip minizip-ng-${{ matrix.deploy-name }}.zip ./Release/mini*zip.exe

- name: Upload release (Windows)
uses: svenstaro/upload-release-action@2.9.0
uses: svenstaro/upload-release-action@2.11.5
if: runner.os == 'Windows' && matrix.deploy && startsWith(github.ref, 'refs/tags/') && env.GITHUB_TOKEN != ''
with:
asset_name: minizip-ng-${{ matrix.deploy-name }}.zip
Expand All @@ -318,3 +376,40 @@ jobs:
overwrite: true
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

coverage:
name: Upload Coverage Reports
runs-on: ubuntu-latest
needs: build
if: always() && !cancelled()
steps:
- name: Download all reports
uses: actions/download-artifact@v7
with:
pattern: Coverage Report - *
merge-multiple: true

- name: Collect coverage report paths
shell: bash
run: |
shopt -s nullglob
files=(coverage-*.xml)
if [ ${#files[@]} -eq 0 ]; then
echo "No coverage reports found, skipping upload."
exit 0
fi
printf '%s\n' "${files[@]}"
IFS=','
echo "COVERAGE_REPORTS=${files[*]}" >> $GITHUB_ENV

- name: Publish coverage reports
uses: codecov/codecov-action@v6
if: env.COVERAGE_REPORTS != '' && env.CODECOV_TOKEN != ''
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.COVERAGE_REPORTS }}
name: ${{ github.workflow }}-${{ github.event_name }}
verbose: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
12 changes: 7 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CodeQL
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 1 * * 4'
concurrency:
Expand All @@ -17,20 +18,21 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: c-cpp

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
4 changes: 2 additions & 2 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: OSS-Fuzz
on: [pull_request]
on: [pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand All @@ -21,7 +21,7 @@ jobs:
dry-run: true

- name: Upload Crash
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: failure()
with:
name: artifacts
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint
on: [workflow_dispatch, pull_request]
env:
TERM: xterm-256color
CLANG_VERSION: 19

jobs:
clang-format:
name: Clang-Format
runs-on: ubuntu-latest
steps:
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
UBCN=$(lsb_release --short --codename)
sudo add-apt-repository "deb https://apt.llvm.org/${UBCN}/ llvm-toolchain-${UBCN}-${CLANG_VERSION} main"
sudo apt update || true
sudo apt install -y clang-format-${CLANG_VERSION}

- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
lfs: true

- name: Run clang-format
run: |
if ! git clang-format-${CLANG_VERSION} --binary=clang-format-${CLANG_VERSION} --diff --commit=origin/develop
then
echo -e "\033[1;31mCode style does not match clang-format"
exit 1
fi
Loading