-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (203 loc) · 6.68 KB
/
ci.yaml
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: CI
on: push
env:
cpm-path: .cpm
cpm-key: zlib-1.3.1-cpm
jobs:
build:
name: ${{ matrix.preset }}-${{ matrix.config }}-${{ matrix.sanitize }}
strategy:
fail-fast: false
matrix:
preset: [linux-clang, linux-gcc, macos, windows]
config: [Debug, Release]
sanitize: [address, thread, undefined, leak, memory]
exclude:
- { preset: linux-gcc, sanitize: memory }
- { preset: macos, sanitize: leak }
- { preset: macos, sanitize: memory }
- { preset: windows, sanitize: thread }
- { preset: windows, sanitize: undefined }
- { preset: windows, sanitize: leak }
- { preset: windows, sanitize: memory }
include:
- { preset: linux-clang, os: ubuntu-latest }
- { preset: linux-gcc, os: ubuntu-latest }
- { preset: macos, os: macos-latest }
- { preset: windows, os: windows-latest }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: ${{ env.cpm-key }}
enableCrossOsArchive: true
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Configure
run: >
cmake --preset ${{ matrix.preset }}
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO
-DCPM_SOURCE_CACHE="${{ env.cpm-path }}"
-DZLIB_SANITIZE=${{ matrix.sanitize }}
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }}
- name: Test
run: ctest --preset ${{ matrix.preset }} -C ${{ matrix.config }}
- name: Install
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }} -t install
build-mobile:
name: ${{ matrix.preset }}-${{ matrix.config }}
strategy:
fail-fast: false
matrix:
preset: [android, ios]
config: [Debug, Release]
include:
- { preset: android, os: ubuntu-latest }
- { preset: ios, os: macos-latest }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: ${{ env.cpm-key }}
enableCrossOsArchive: true
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Configure
run: >
cmake --preset ${{ matrix.preset }}
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }}
- name: Install
run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.config }} -t install
build-bsd:
name: ${{ matrix.preset }}-${{ matrix.arch }}-${{ matrix.config }}
strategy:
fail-fast: false
matrix:
preset: [freebsd, netbsd, openbsd]
arch: [arm64, x86_64]
config: [Debug, Release]
include:
- preset: freebsd
version: "14.2"
install: sudo pkg install -y cmake ninja
- preset: netbsd
version: "10.0"
install: sudo pkgin -y install cmake ninja-build gcc13
- preset: openbsd
version: "7.6"
install: sudo pkg_add cmake ninja
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: ${{ env.cpm-key }}
enableCrossOsArchive: true
- uses: cross-platform-actions/action@master
with:
operating_system: ${{ matrix.preset }}
architecture: ${{ matrix.arch }}
version: ${{ matrix.version }}
run: |
${{ matrix.install }}
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
-DCPM_SOURCE_CACHE=${{ env.cpm-path }} \
-DZLIB_INSTALL=ON \
-DZLIB_TEST=ON \
-DZLIB_VERBOSE=ON
cmake --build build
cd build
ctest -V -C ${{ matrix.config }}
cd ..
cmake --install build
build-msys2:
name: msys2-${{ matrix.preset }}-${{ matrix.config }}
strategy:
fail-fast: false
matrix:
preset: [CLANG64, MINGW32, MINGW64, UCRT64]
config: [Debug, Release]
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.cpm-path }}
key: ${{ env.cpm-key }}
enableCrossOsArchive: true
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.preset }}
update: true
pacboy: >-
cmake:p
gcc:p
ninja:p
- name: Configure
run: >
cmake -B build -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_INSTALL=ON
-DZLIB_TEST=ON
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build build
- name: Test
working-directory: build
run: ctest -V -C ${{ matrix.config }}
- name: Install
run: cmake --install build
build-cygwin:
name: cygwin-${{ matrix.config }}
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
runs-on: windows-latest
defaults:
run:
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
steps:
- uses: actions/checkout@v4
- uses: cygwin/cygwin-install-action@v5
with:
packages: cmake gcc-core ninja
- name: Configure
run: >
cmake -B build -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
-DCPM_SOURCE_CACHE=${{ env.cpm-path }}
-DZLIB_INSTALL=ON
-DZLIB_TEST=ON
-DZLIB_VERBOSE=ON
- name: Build
run: cmake --build build
- name: Test
working-directory: build
run: ctest -V -C ${{ matrix.config }}
- name: Install
run: cmake --install build