forked from zlib-ng/zlib-ng
-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (146 loc) · 5.17 KB
/
pigz.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Pigz
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pigz:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
codecov: ubuntu_gcc_pigz
- name: Ubuntu GCC Symbol Prefix
os: ubuntu-latest
compiler: gcc
codecov: ubuntu_gcc_pigz
cmake-args: -DZLIB_SYMBOL_PREFIX=zTest_
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
packages: llvm-11 llvm-11-tools
gcov-exec: llvm-cov-11 gcov
codecov: ubuntu_clang_pigz
- name: Ubuntu Clang No Optim
os: ubuntu-latest
compiler: clang
packages: llvm-11 llvm-11-tools
gcov-exec: llvm-cov-11 gcov
codecov: 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-11 llvm-11-tools
gcov-exec: llvm-cov-11 gcov
codecov: ubuntu_clang_pigz_no_threads
cmake-args: -DWITH_THREADS=OFF -DPIGZ_VERSION=v2.6
- name: Ubuntu GCC AARCH64
os: ubuntu-latest
cmake-args: -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain-aarch64.cmake
packages: qemu qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross
codecov: ubuntu_gcc_pigz_aarch64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: 'false'
- name: Checkout test corpora
uses: actions/checkout@v4
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 . -j2 --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.parallels-jobs || '3' }}
working-directory: test/pigz
- name: Generate coverage report
if: matrix.codecov
run: |
python3 -u -m pip install --user gcovr==5.0
python3 -m gcovr -j 3 --verbose \
--exclude-unreachable-branches \
--gcov-executable "${{ matrix.gcov-exec || 'gcov' }}" \
--root . \
--xml --output ${{ matrix.codecov }}.xml
- name: Upload coverage report artifact
uses: actions/upload-artifact@v4
if: matrix.codecov
with:
name: ${{ matrix.name }} (coverage)
path: ${{ matrix.codecov }}.xml
retention-days: 1
- name: Upload build errors
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
**/CMakeFiles/CMakeOutput.log
**/CMakeFiles/CMakeError.log
**/Testing/Temporary/*
coverage.xml
retention-days: 30
coverage:
name: Upload Coverage Reports
runs-on: ubuntu-latest
needs: pigz
if: cancelled() == false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false
- name: Download all reports
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Display all coverage artifacts
run: |
ls -R *.xml
echo "CODECOV_REPORTS=`ls -p *.xml | grep -v / | tr '\n' ',' | sed 's/,$//g'`" >> $GITHUB_ENV
- name: Upload reports
uses: codecov/codecov-action@v5
if: (env.CODECOV_TOKEN != '' || github.repository == 'zlib-ng/zlib-ng')
with:
files: ${{ env.CODECOV_REPORTS }}
name: pigz-umbrella
verbose: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"