summaryrefslogtreecommitdiff
path: root/neozip/.github/workflows/pigz.yml
diff options
context:
space:
mode:
Diffstat (limited to 'neozip/.github/workflows/pigz.yml')
-rw-r--r--neozip/.github/workflows/pigz.yml135
1 files changed, 135 insertions, 0 deletions
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