• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI Pigz
2on: [push, pull_request]
3jobs:
4  ci-cmake:
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            # Use v2.6 due to NOTHREADS bug https://github.com/madler/pigz/issues/97
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@v2
55
56    - name: Checkout test corpora
57      uses: actions/checkout@v2
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        cd test/pigz
71        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
72      env:
73        CC: ${{ matrix.compiler }}
74        CFLAGS: ${{ matrix.cflags }}
75        LDFLAGS: ${{ matrix.ldflags }}
76        CI: true
77
78    - name: Compile source code
79      run: |
80        cd test/pigz
81        cmake --build . --config ${{ matrix.build-config || 'Release' }}
82
83    - name: Run test cases
84      run: |
85        cd test/pigz
86        ctest --verbose -C Release --output-on-failure --max-width 120 -j ${{ matrix.parallels-jobs || '2' }}
87
88    - name: Generate coverage report
89      if: matrix.codecov
90      run: |
91        python3 -u -m pip install --user gcovr==5.0
92        python3 -m gcovr --exclude-unreachable-branches --gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" --root . --xml --output coverage.xml -j 3 --verbose
93
94    - name: Upload coverage report
95      uses: codecov/codecov-action@v2
96      if: matrix.codecov && (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng')
97      with:
98        token: ${{ secrets.CODECOV_TOKEN || 'e4fdf847-f541-4ab1-9d50-3d27e5913906' }}
99        flags: ${{ matrix.codecov }}
100        name: ${{ matrix.name }}
101        verbose: true
102        fail_ci_if_error: true
103      env:
104        CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
105
106    - name: Upload build errors
107      uses: actions/upload-artifact@v2
108      if: failure()
109      with:
110        name: ${{ matrix.name }} (cmake)
111        path: |
112          **/CMakeFiles/CMakeOutput.log
113          **/CMakeFiles/CMakeError.log
114          **/Testing/Temporary/*
115          coverage.xml
116        retention-days: 30
117