-
Notifications
You must be signed in to change notification settings - Fork 262
286 lines (285 loc) · 10.6 KB
/
build.yml
File metadata and controls
286 lines (285 loc) · 10.6 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
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
name: cesium-native
on: [push, pull_request]
env:
VCPKG_BINARY_SOURCES: 'clear;x-aws,s3://cesium-builds/vcpkg/cesium-native-cache/,readwrite'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_INTERNAL_SERVICES_VCPKG_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_INTERNAL_SERVICES_VCPKG_SECRET_KEY }}
AWS_REGION: us-east-1
jobs:
QuickChecks:
name: "Quick Checks"
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Check source formatting
run: |
npm install
npm run format -- --dry-run -Werror
Linting:
name: "Linting"
runs-on: ubuntu-24.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install latest CMake 3 and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.9
with:
key: ccache-ubuntu-24.04-clang-clang-tidy
- name: Install latest clang and clang-tidy
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo apt-get install clang-tidy-19
- name: Set CC and CXX
run: |
echo "CC=/usr/bin/clang-19" >> "$GITHUB_ENV"
echo "CXX=/usr/bin/clang++-19" >> "$GITHUB_ENV"
echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV"
- name: Make more swap space available
run: |
sudo swapoff -a
sudo fallocate -l 10G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
sudo swapon --show
- name: Run clang-tidy
run: |
echo `$CC --version | head -n 1`, `cmake --version | head -n 1`
cp doc/cmake-presets/CMakeUserPresets.json .
cmake --preset=vcpkg-linux -DCMAKE_BUILD_TYPE=Debug -DCESIUM_CLANG_TIDY_USE_THREADS=4
cmake --build build --target clang-tidy > output.log
- name: Print vcpkg problems
if: ${{ failure() }}
run: |
cat "/usr/local/share/vcpkg/buildtrees/doctest/config-x64-linux-dbg-out.log"
cat "/usr/local/share/vcpkg/buildtrees/doctest/config-x64-linux-dbg-err.log"
- name: List clang-tidy warnings & errors
if: ${{ !cancelled() }}
run: |
sed -n '/\(error\|warning\):/,/^$/p' output.log
# On macOS, the above doesn't work because the escaped pipe is not supported.
# Instead, use two commands:
# sed -n '/error:/,/^$/p' output.log
# sed -n '/warning:/,/^$/p' output.log
Documentation:
runs-on: ubuntu-24.04
steps:
- name: Install Doxygen
run: |
cd ~
wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz
tar xzf doxygen-1.13.2.linux.bin.tar.gz
export PATH=$PWD/doxygen-1.13.2/bin:$PATH
echo "PATH=$PATH" >> "$GITHUB_ENV"
echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV"
doxygen --version
- name: Install latest CMake 3 and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.9
with:
key: ccache-ubuntu-24.04-doxygen
- name: Generate Documentation
run: |
npm install
cp doc/cmake-presets/CMakeUserPresets.json .
cmake --preset=vcpkg-linux
cmake --build build --target cesium-native-docs
- name: Publish Documentation Artifact
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: ReferenceDocumentation
path: build/doc/html
WindowsBuild:
strategy:
fail-fast: false
matrix:
platform: [windows-2022]
build_type: [Debug, RelWithDebInfo]
name: "${{matrix.platform}} / ${{matrix.build_type}}"
env:
CACHE_KEY: "${{ matrix.platform }}"
runs-on: ${{ matrix.platform }}
steps:
- name: Install latest CMake 3 and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup MSVC for command-line builds
uses: ilammy/msvc-dev-cmd@v1
- name: sccache
uses: hendrikmuhs/ccache-action@v1.2.9
with:
key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}}-1
variant: sccache
- name: Compile ${{matrix.build_type}} Configuration
run: |
$env:VCPKG_ROOT="$env:VCPKG_INSTALLATION_ROOT"
Copy .\doc\cmake-presets\CMakeUserPresets.json .\
cmake --preset=vcpkg-windows -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_C_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache -DCMAKE_CXX_COMPILER_LAUNCHER=C:\\Users\\runneradmin\\.cargo\\bin\\sccache
cmake --build build
- name: Test ${{matrix.build_type}} Configuration
run: |
cd build
ctest -V
PosixBuild:
strategy:
fail-fast: false
matrix:
compiler: [ gcc, clang ]
platform: [ ubuntu-24.04, ubuntu-22.04, macos-14 ]
build_type: [Debug, RelWithDebInfo]
exclude:
- compiler: clang
platform: ubuntu-24.04
- compiler: gcc
platform: macos-14
- compiler: gcc
platform: ubuntu-22.04
name: "${{matrix.platform}} / ${{matrix.compiler}} / ${{matrix.build_type}}"
env:
CACHE_KEY: "${{ matrix.platform }}-${{matrix.compiler}}"
runs-on: ${{ matrix.platform }}
steps:
- name: Install latest CMake 3 and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.9
with:
key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}}
- name: Set CC and CXX
if: ${{ matrix.compiler == 'clang' && matrix.platform != 'macos-14'}}
run: |
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
- name: add VCPKG_ROOT
run: |
echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV"
- name: Make more swap space available
if: ${{ matrix.platform != 'macos-14'}}
run: |
sudo swapoff -a
sudo fallocate -l 10G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
sudo swapon --show
- name: Set macOS cmake options
if: ${{ matrix.platform == 'macos-14' }}
run: |
# Use a custom triplet to target macOS 10.15.
mkdir -p vcpkg/triplets
echo "
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_OSX_DEPLOYMENT_TARGET 10.15)
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_OSX_ARCHITECTURES x86_64)
" > vcpkg/triplets/x64-macos-10-15.cmake
# Specify the overlay triplet, and also tell cesium-native to build with the same settings.
echo "EXTRA_CMAKE_OPTIONS=-DVCPKG_OVERLAY_TRIPLETS=$PWD/vcpkg/triplets -DVCPKG_TRIPLET=x64-macos-10-15 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DVCPKG_TARGET_TRIPLET=x64-macos-10-15" >> "$GITHUB_ENV"
- name: Compile ${{matrix.build_type}} Configuration
run: |
cp doc/cmake-presets/CMakeUserPresets.json .
cmake --preset=vcpkg -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} $EXTRA_CMAKE_OPTIONS
cmake --build build --parallel
- name: Test ${{matrix.build_type}} Configuration
run: |
cd build
ctest -V
EmscriptenBuild:
strategy:
fail-fast: false
matrix:
version: [ "3.1.39", "4.0.13" ]
memory: [ "32", "64" ]
exclude:
- version: "3.1.39"
memory: "64"
name: Emscripten v${{matrix.version}} ${{matrix.memory}}bit memory
env:
CACHE_KEY: "emscripten-${{matrix.version}}-${{matrix.memory}}"
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Use NodeJS 24 for WebAssembly 64-bit memory support
if: ${{ matrix.memory == '64' }}
uses: actions/setup-node@v6
with:
node-version: '>=24'
- name: Checkout vcpkg 2025.02.14 packages for use with Emscripten 3.1.39
if: ${{ matrix.version == '3.1.39' }}
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
clean: false
ref: 2025.02.14
path: extern/vcpkg/temp
sparse-checkout-cone-mode: false
sparse-checkout: |
ports/ada-url
- name: Move overlay ports to the correct location
if: ${{ matrix.version == '3.1.39' }}
run: |
mv extern/vcpkg/temp/ports/* extern/vcpkg/ports/
- name: Add OpenSSL "no-dso" option on older Emscripten versions
if: ${{ matrix.version == '3.1.39' }}
run: |
echo "
if(PORT MATCHES "openssl")
set(VCPKG_CONFIGURE_MAKE_OPTIONS "no-dso")
endif()
" >> extern/vcpkg/triplets/wasm32-emscripten-cesium.cmake
- name: Install latest CMake 3 and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "3.31.6"
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{matrix.version}}
- name: Verify
run: emcc -v
- name: Compile Debug Configuration
run: |
$env:VCPKG_ROOT="$env:VCPKG_INSTALLATION_ROOT"
$MEMORYPROPERTY="${{matrix.memory}}" -eq "64" ? "-DCESIUM_WASM64=ON" : ""
emcmake cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug $MEMORYPROPERTY
cmake --build build --config Debug --parallel
- name: Test Debug Configuration
run: |
node build/CesiumNativeTests/cesium-native-tests.js