| 1 |
name: Pigz |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
pigz: |
| 5 |
name: ${{ matrix.name }} |
| 6 |
runs-on: ${{ matrix.os }} |
| 7 |
strategy: |
| 8 |
fail-fast: false |
| 9 |
matrix: |
| 10 |
include: |
| 11 |
- name: Ubuntu GCC |
| 12 |
os: ubuntu-latest |
| 13 |
compiler: gcc |
| 14 |
codecov: ubuntu_gcc_pigz |
| 15 |
|
| 16 |
- name: Ubuntu GCC Symbol Prefix |
| 17 |
os: ubuntu-latest |
| 18 |
compiler: gcc |
| 19 |
codecov: ubuntu_gcc_pigz |
| 20 |
cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_ |
| 21 |
|
| 22 |
- name: Ubuntu Clang |
| 23 |
os: ubuntu-latest |
| 24 |
compiler: clang |
| 25 |
packages: llvm-11-tools |
| 26 |
gcov-exec: llvm-cov-11 gcov |
| 27 |
codecov: ubuntu_clang_pigz |
| 28 |
|
| 29 |
- name: Ubuntu Clang No Optim |
| 30 |
os: ubuntu-latest |
| 31 |
compiler: clang |
| 32 |
packages: llvm-11-tools |
| 33 |
gcov-exec: llvm-cov-11 gcov |
| 34 |
codecov: ubuntu_clang_pigz_no_optim |
| 35 |
cmake-args: -DWITH_OPTIM=OFF |
| 36 |
|
| 37 |
|
| 38 |
- name: Ubuntu Clang No Threads |
| 39 |
os: ubuntu-latest |
| 40 |
compiler: clang |
| 41 |
packages: llvm-11-tools |
| 42 |
gcov-exec: llvm-cov-11 gcov |
| 43 |
codecov: ubuntu_clang_pigz_no_threads |
| 44 |
cmake-args: -DWITH_THREADS=OFF -DPIGZ_VERSION=v2.6 |
| 45 |
|
| 46 |
- name: Ubuntu GCC AARCH64 |
| 47 |
os: ubuntu-latest |
| 48 |
cmake-args: -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-aarch64.cmake |
| 49 |
packages: qemu qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross |
| 50 |
codecov: ubuntu_gcc_pigz_aarch64 |
| 51 |
|
| 52 |
steps: |
| 53 |
- name: Checkout repository |
| 54 |
uses: actions/checkout@v3 |
| 55 |
|
| 56 |
- name: Checkout test corpora |
| 57 |
uses: actions/checkout@v3 |
| 58 |
with: |
| 59 |
repository: zlib-ng/corpora |
| 60 |
path: test/data/corpora |
| 61 |
|
| 62 |
- name: Install packages (Ubuntu) |
| 63 |
if: runner.os == 'Linux' && matrix.packages |
| 64 |
run: | |
| 65 |
sudo apt-get update |
| 66 |
sudo apt-get install -y ${{ matrix.packages }} |
| 67 |
|
| 68 |
- name: Generate project files |
| 69 |
run: | |
| 70 |
cmake ${{ matrix.cmake-args }} \ |
| 71 |
-DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} \ |
| 72 |
-DBUILD_SHARED_LIBS=OFF \ |
| 73 |
-DZLIB_ROOT=../.. \ |
| 74 |
-DWITH_CODE_COVERAGE=ON \ |
| 75 |
-DWITH_MAINTAINER_WARNINGS=ON |
| 76 |
working-directory: test/pigz |
| 77 |
env: |
| 78 |
CC: ${{ matrix.compiler }} |
| 79 |
CFLAGS: ${{ matrix.cflags }} |
| 80 |
LDFLAGS: ${{ matrix.ldflags }} |
| 81 |
CI: true |
| 82 |
|
| 83 |
- name: Compile source code |
| 84 |
run: cmake --build . --config ${{ matrix.build-config || 'Release' }} |
| 85 |
working-directory: test/pigz |
| 86 |
|
| 87 |
- name: Run test cases |
| 88 |
run: ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '2' }} |
| 89 |
working-directory: test/pigz |
| 90 |
|
| 91 |
- name: Generate coverage report |
| 92 |
if: matrix.codecov |
| 93 |
run: | |
| 94 |
python3 -u -m pip install --user gcovr==5.0 |
| 95 |
python3 -m gcovr -j 3 --verbose \ |
| 96 |
--exclude-unreachable-branches \ |
| 97 |
--gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \ |
| 98 |
--root . \ |
| 99 |
--xml --output coverage.xml |
| 100 |
|
| 101 |
- name: Upload coverage report |
| 102 |
uses: codecov/codecov-action@v2 |
| 103 |
if: matrix.codecov && (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng') |
| 104 |
with: |
| 105 |
token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }} |
| 106 |
flags: ${{ matrix.codecov }} |
| 107 |
name: ${{ matrix.name }} |
| 108 |
verbose: true |
| 109 |
fail_ci_if_error: true |
| 110 |
env: |
| 111 |
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} |
| 112 |
|
| 113 |
- name: Upload build errors |
| 114 |
uses: actions/upload-artifact@v2 |
| 115 |
if: failure() |
| 116 |
with: |
| 117 |
name: ${{ matrix.name }} (cmake) |
| 118 |
path: | |
| 119 |
**/CMakeFiles/CMakeOutput.log |
| 120 |
**/CMakeFiles/CMakeError.log |
| 121 |
**/Testing/Temporary/* |
| 122 |
coverage.xml |
| 123 |
retention-days: 30 |