-
-
Notifications
You must be signed in to change notification settings - Fork 160
368 lines (321 loc) · 13.2 KB
/
cmake.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
name: CMake
on: [push, pull_request]
jobs:
build-windows:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- type: Win32
triplet: x86-windows-static
mono: ''
dll_sfx: windows.i386
- type: x64
triplet: x64-windows-static
mono: ''
dll_sfx: windows.amd64
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}\vcpkg\vcpkg.exe
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: cmd
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: bootstrap-vcpkg.bat
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -A ${{ matrix.type }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
- name: Build
shell: bash
working-directory: ${{github.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
shell: bash
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-macos:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
triplet: x64-osx
mono: 'mono'
dll_sfx: macos.amd64
- arch: arm64
triplet: arm64-osx
mono: 'mono'
dll_sfx: macos.aarch64
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
- name: Build
working-directory: ${{github.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-linux:
env:
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- apt: g++-8
cc: gcc-8
cxx: g++-8
triplet: x64-linux
mono: 'mono'
dll_sfx: linux.amd64
- path: /usr/i686-linux-gnu
apt: g++-8-i686-linux-gnu
cc: i686-linux-gnu-gcc-8
cxx: i686-linux-gnu-g++-8
triplet: x86-linux
mono: 'mono'
dll_sfx: linux.i386
- path: /usr/aarch64-linux-gnu
apt: g++-aarch64-linux-gnu
cc: aarch64-linux-gnu-gcc
cxx: aarch64-linux-gnu-g++
triplet: arm64-linux
mono: 'mono'
dll_sfx: linux.aarch64
- path: /usr/arm-linux-gnueabihf
apt: g++-arm-linux-gnueabihf
cc: arm-linux-gnueabihf-gcc
cxx: arm-linux-gnueabihf-g++
triplet: arm-linux
mono: 'mono'
dll_sfx: linux.arm
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Install Cross Compiler
run: sudo apt-get update && sudo apt-get install ${{ matrix.apt }}
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}/triplets -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCMAKE_PREFIX_PATH=${{ matrix.path }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"
build-android:
env:
ANDROID_NDK: $ANDROID_NDK_HOME
BUILD_TYPE: Release
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
include:
- abi: armeabi-v7a with NEON
triplet: arm-neon-android
mono: 'mono'
dll_sfx: android.arm
- abi: arm64-v8a
triplet: arm64-android
mono: 'mono'
dll_sfx: android.aarch64
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Cache
uses: actions/cache@v3
id: cache
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/vcpkg/vcpkg
# An explicit key for restoring and saving the cache
key: ${{ runner.os }}-${{ matrix.triplet }}-20231006
restore-keys: ${{ runner.os }}-${{ matrix.triplet }}-20231006
- name: Setup Vcpkg
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/vcpkg
run: ./bootstrap-vcpkg.sh
- name: 'Setup NuGet Credentials'
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Dice-Developer-Team/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Dice-Developer-Team"
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDLL_SUFFIX=.${{matrix.dll_sfx}} -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DANDROID_ABI="${{ matrix.abi }}" -DCMAKE_SYSTEM_NAME=ANDROID -DANDROID_PLATFORM=21 -DCMAKE_SYSTEM_VERSION=21
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
- name: Upload
uses: actions/upload-artifact@v3
with:
# Artifact name
name: ${{ matrix.triplet }}
# A file, directory or wildcard pattern that describes what to upload
path: "**/w4123.Dice.${{ matrix.dll_sfx }}.dll"