Repository navigation
197 lines (170 loc) · 6.04 KB
/
Copy pathcmake.yml
File metadata and controls
197 lines (170 loc) · 6.04 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CMake
on: [push, pull_request]
jobs:
ci-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
cflags: -Wall -Wextra
pkgtgt: package package_source
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: Ubuntu GCC no shared
os: ubuntu-latest
compiler: gcc
cflags: -Wall -Wextra
pkgtgt: package package_source
cmake-args: -DZLIB_BUILD_SHARED=OFF -DMINIZIP_ENABLE_BZIP2=ON
- name: Ubuntu GCC no static
os: ubuntu-latest
compiler: gcc
cflags: -Wall -Wextra
pkgtgt: package package_source
cmake-args: -DZLIB_BUILD_STATIC=OFF -DMINIZIP_ENABLE_BZIP2=ON
- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
cflags: -O3 -Wall -Wextra
pkgtgt: package package_source
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
cflags: -Wall -Wextra
pkgtgt: package package_source
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: Ubuntu Clang Debug
os: ubuntu-latest
compiler: clang
cflags: -Wall -Wextra
build-config: Debug
pkgtgt: package package_source
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: Windows MSVC Win32
os: windows-latest
compiler: cl
cflags: /W3
cmake-args: -A Win32
pkgtgt: PACKAGE
- name: Windows MSVC Win64
os: windows-latest
compiler: cl
cflags: /W3
cmake-args: -A x64 -DMINIZIP_ENABLE_BZIP2=OFF
pkgtgt: PACKAGE
- name: Windows MSVC ARM64
os: windows-11-arm
compiler: cl
cflags: /W3
cmake-args: -A ARM64 -DMINIZIP_ENABLE_BZIP2=OFF
pkgtgt: PACKAGE
- name: Windows GCC
os: windows-latest
compiler: gcc
cflags: -Wall -Wextra
cmake-args: -G Ninja -DMINIZIP_ENABLE_BZIP2=OFF
pkgtgt: package
- name: macOS Clang
os: macos-latest
compiler: clang
cflags: -Wall -Wextra
pkgtgt: package
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: macOS GCC 13
os: macos-latest
compiler: gcc-13
cflags: -Wall -Wextra
pkgtgt: package
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: macOS GCC 14
os: macos-latest
compiler: gcc-14
cflags: -Wall -Wextra
pkgtgt: package
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
- name: macOS GCC 15
os: macos-latest
compiler: gcc-15
cflags: -Wall -Wextra
pkgtgt: package
cmake-args: -DMINIZIP_ENABLE_BZIP2=ON
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
foreach ($try in 1..3) {
choco install --no-progress nsis
if (Test-Path "${env:ProgramFiles(x86)}\NSIS\makensis.exe") { exit 0 }
Start-Sleep -Seconds 60
}
exit 1
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt install libbz2-dev
- name: Generate project files
run: cmake -S . -B ../build ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DZLIB_BUILD_MINIZIP=ON
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
- name: Compile source code
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }}
- name: Run test cases
run: ctest -C Release --output-on-failure --max-width 120
working-directory: ../build
- name: create packages
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }} -t ${{ matrix.pkgtgt }}
- name: Upload build errors
uses: actions/upload-artifact@v6
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
${{ runner.workspace }}/build/CMakeFiles/CMakeConfigureLog.yaml
${{ runner.workspace }}/build/CMakeFiles/CMakeOutput.log
${{ runner.workspace }}/build/CMakeFiles/CMakeError.log
retention-days: 7
ci-cmake-minimum:
name: Ubuntu GCC minimum CMake
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install packages
run: |
sudo apt install libbz2-dev
- name: Install the minimum CMake version
run: |
min=$(sed -n 's/^cmake_minimum_required(VERSION \([0-9]*\.[0-9]*\).*/\1/p' CMakeLists.txt)
python3 -m venv "$RUNNER_TEMP/cmake-min"
"$RUNNER_TEMP/cmake-min/bin/pip" install "cmake==$min.*"
echo "$RUNNER_TEMP/cmake-min/bin" >> "$GITHUB_PATH"
- name: Generate project files
run: |
cmake --version
cmake -S . -B ../build -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_BLAST=ON -DZLIB_BUILD_IOSTREAM3=ON -DZLIB_BUILD_MINIZIP=ON -DZLIB_BUILD_PUFF=ON -DMINIZIP_ENABLE_BZIP2=ON
env:
CC: gcc
CFLAGS: -Wall -Wextra
- name: Compile source code
run: cmake --build ../build --config Release
- name: Run test cases
run: ctest -C Release --output-on-failure
working-directory: ../build
- name: Upload build errors
uses: actions/upload-artifact@v6
if: failure()
with:
name: Ubuntu GCC minimum CMake (cmake)
path: |
${{ runner.workspace }}/build/CMakeFiles/CMakeConfigureLog.yaml
${{ runner.workspace }}/build/CMakeFiles/CMakeOutput.log
${{ runner.workspace }}/build/CMakeFiles/CMakeError.log
retention-days: 7