-
Notifications
You must be signed in to change notification settings - Fork 1
285 lines (262 loc) · 8.78 KB
/
ci.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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: CI
on: [push]
defaults:
run:
shell: bash
env:
CCACHE_SLOPPINESS: pch_defines,time_macros
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
name: "GCC 11 / Release"
cc: gcc
cc_ver: 11
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-22.04
name: "GCC 12 / Release"
cc: gcc
cc_ver: 12
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-24.04
name: "GCC 13 / Release"
cc: gcc
cc_ver: 13
cxx: g++
libcxx: libstdc++11
build_args: ""
- os: ubuntu-22.04
name: "Clang 15 / Release"
cc: clang
cc_ver: 15
cxx: clang++
libcxx: libc++
apt: libc++-15-dev libc++abi-15-dev libc++-14-dev- libc++1-14- libc++abi-14-dev- libc++abi1-14- libunwind-14- libunwind-14-dev-
build_args: ""
- os: ubuntu-24.04
name: "Clang 17 / Release"
cc: clang
cc_ver: 17
cxx: clang++
libcxx: libc++
apt: libc++-17-dev libc++abi-17-dev libc++-18-dev- libc++1-18- libc++abi-18-dev- libc++abi1-18- libunwind-18- libunwind-18-dev-
build_args: ""
- os: ubuntu-24.04
name: "Clang 18 / Release"
cc: clang
cc_ver: 18
cxx: clang++
libcxx: libc++
apt: libc++-18-dev libc++abi-18-dev
build_args: ""
- os: ubuntu-24.04
name: "GCC 14 / Debug ASAN"
cc: gcc
cc_ver: 14
cxx: g++
libcxx: libstdc++11
build_args: "--debug --asan --ubsan"
- os: ubuntu-24.04
name: "GCC 14 / MinSizeRel Unity"
cc: gcc
cc_ver: 14
cxx: g++
libcxx: libstdc++11
build_args: "--minsize --unity"
- os: macos-15
name: "Clang 18 arm64 / Release"
cc: clang
cc_ver: 18
libcxx: libc++
clang: llvm@18
os_target: "15.0"
build_args: ""
- os: macos-13
name: "Xcode 14.3 / Release"
cc: apple-clang
cc_ver: 14
libcxx: libc++
clang: Xcode_14.3
os_target: "13.0"
build_args: ""
- os: macos-13
name: "Xcode 15.2 / Release"
cc: apple-clang
cc_ver: 15
libcxx: libc++
clang: Xcode_15.2.0
os_target: "13.0"
build_args: ""
- os: macos-14
name: "Xcode 15.4 arm64 / Release"
cc: apple-clang
cc_ver: 15
libcxx: libc++
clang: Xcode_15.4.0
os_target: "14.0"
build_args: ""
- os: macos-15
name: "Xcode 16.1 arm64 / Release"
cc: apple-clang
cc_ver: 16
libcxx: libc++
clang: Xcode_16.1.0
os_target: "15.0"
build_args: ""
- os: windows-2019
name: "VS 16 / Release"
cc: msvc
cc_ver: 192
build_args: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=1"
- os: windows-2022
name: "VS 17 / Release"
cc: msvc
cc_ver: 194
build_args: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=1"
name: ${{ matrix.os }} / ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_REVISIONS_ENABLED: 1
BUILD_ARGS: ${{ matrix.build_args }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- uses: ilammy/msvc-dev-cmd@v1
- name: "install tools and deps"
id: tools
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y ninja-build \
libsdl2-dev libfreetype6-dev libharfbuzz-dev libhyperscan-dev \
${{ matrix.apt }}
export CC=${{ matrix.cc }}-${{ matrix.cc_ver }}
export CXX=${{ matrix.cxx }}-${{ matrix.cc_ver }}
echo "CC='$CC'" >> $GITHUB_ENV
echo "CXX='$CXX'" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install ninja sdl2 doxygen google-benchmark libzip
if [[ "$(uname -m)" == "x86_64" ]]; then
brew install hyperscan
# WORKAROUND: broken cmake config in brew harfbuzz package
ln -s /usr/local/lib/libharfbuzz.0.dylib /usr/local/lib/libharfbuzz.0..dylib
else
brew install vectorscan
fi
if [[ "${{ matrix.clang }}" == llvm* ]] ; then
export CC="$(brew --prefix ${{ matrix.clang }})/bin/clang"
export CXX="$(brew --prefix ${{ matrix.clang }})/bin/clang++"
echo "CC='$CC'" >> $GITHUB_ENV
echo "CXX='$CXX'" >> $GITHUB_ENV
else
sudo xcode-select -s "/Applications/${{ matrix.clang }}.app"
fi
export MACOSX_DEPLOYMENT_TARGET=${{ matrix.os_target }}
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >> $GITHUB_ENV
elif [[ "$RUNNER_OS" == "Windows" ]]; then
# remove MinGW's link as it collides with MSVC
mv /usr/bin/link /usr/bin/link.orig
# upgrade tools
choco install ccache ninja
which ccache; ccache --version
which ninja; ninja --version
fi
# Install conan
pip3 --no-cache-dir install conan
conan --version
echo "CONAN_HOME=$(conan config home)" >> $GITHUB_OUTPUT
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: ${{ matrix.os }}-${{ matrix.name }}
- name: conan cache
uses: actions/cache@v4
with:
path: ${{ steps.tools.outputs.CONAN_HOME }}
key: ${{ matrix.os }}-${{ matrix.name }}-${{ hashFiles('conanfile.py', 'conandata.yml') }}-${{github.sha}}
restore-keys: |
${{ matrix.os }}-${{ matrix.name }}-${{ hashFiles('conanfile.py', 'conandata.yml') }}-
${{ matrix.os }}-${{ matrix.name }}-
${{ matrix.os }}-
- name: conan config
run: |
mkdir -p "$(conan config home)/profiles"
cat <<EOF > "$(conan config home)/profiles/default"
[settings]
os={{ {"Darwin": "Macos"}.get(platform.system(), platform.system()) }}
arch={{ {"arm64": "armv8", "AMD64": "x86_64"}.get(platform.machine(), platform.machine()) }}
build_type=Release
compiler=${{ matrix.cc }}
compiler.version=${{ matrix.cc_ver }}
compiler.cppstd=20
{% if platform.system() == "Windows" %}
compiler.runtime=dynamic
{% else %}
compiler.libcxx=${{ matrix.libcxx }}
{% endif %}
{% if platform.system() == "Darwin" %}
os.version=${{ matrix.os_target }}
{% endif %}
EOF
if [[ "$RUNNER_OS" == "Linux" && "$CXX" = clang* ]]; then
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
fi
if [[ "$RUNNER_OS" == "Windows" ]]; then
# Disable builtin compatibility extension, force exact cppstd
cat <<-EOF > "$(conan config home)/extensions/plugins/compatibility/compatibility.py"
def compatibility(conanfile):
return []
EOF
fi
cat "$(conan config home)/profiles/default"
- name: deps
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
./build_deps.py fmt
fi
./build.sh deps $BUILD_ARGS
- name: configure
run: ./build.sh config $BUILD_ARGS
- name: build
run: ./build.sh build $BUILD_ARGS
- name: test
run: ./build.sh test $BUILD_ARGS
- name: install
if: ${{ matrix.name == 'Release build' }}
run: ./build.sh install $BUILD_ARGS
- name: package
if: ${{ matrix.name == 'Release build' }}
run: ./build.sh package $BUILD_ARGS
- name: artifacts - tarball
if: ${{ matrix.name == 'Release build' }}
uses: actions/upload-artifact@v4
with:
name: xcikit-artifacts
path: |
artifacts/xcikit-*.tar.gz
- name: artifacts - test report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-report
path: |
build/*/Testing/Temporary/LastTest.log
# - name: deploy conan package
# if: github.ref == 'refs/heads/master'
# run: |
# conan remote add xcikit https://api.bintray.com/conan/rbrich/xcikit
# conan user -p $CONAN_PASSWORD -r xcikit rbrich
# conan upload "xcikit/*@rbrich/stable" --all --no-overwrite --check --confirm -r=xcikit