-
Notifications
You must be signed in to change notification settings - Fork 215
162 lines (162 loc) · 5.5 KB
/
build.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
name: cesium-native
on: [push, pull_request]
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
Documentation:
runs-on: ubuntu-22.04
steps:
- name: Install Doxygen
run: |
sudo apt install -y doxygen
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Generate Documentation
run: |
npm install
cmake -B build -S .
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 ninja
uses: seanmiddleditch/gha-setup-ninja@master
- 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/[email protected]
with:
key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}}-1
variant: sccache
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: /.ezvcpkg
key: vcpkg-${{ env.CACHE_KEY }}-${{ hashFiles('CMakeLists.txt') }}-1
- name: Compile ${{matrix.build_type}} Configuration
run: |
cmake -B build -S . -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:
include:
- platform: ubuntu-20.04
build_type: Debug
compiler-cc: clang-12
compiler-cxx: clang++-12
- platform: ubuntu-20.04
build_type: RelWithDebInfo
compiler-cc: clang-12
compiler-cxx: clang++-12
- platform: ubuntu-22.04
build_type: Debug
compiler-cc: gcc
compiler-cxx: g++
- platform: ubuntu-22.04
build_type: RelWithDebInfo
compiler-cc: gcc
compiler-cxx: g++
- platform: ubuntu-24.04
build_type: Debug
compiler-cc: gcc-13
compiler-cxx: g++-13
- platform: ubuntu-24.04
build_type: RelWithDebInfo
compiler-cc: gcc-13
compiler-cxx: g++-13
- platform: macos-15
build_type: Debug
- platform: macos-15
build_type: RelWithDebInfo
name: "${{matrix.platform}} / ${{matrix.compiler-cc}} / ${{matrix.build_type}}"
env:
CACHE_KEY: "${{ matrix.platform }}-${{matrix.compiler}}"
runs-on: ${{ matrix.platform }}
steps:
- name: Install ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install nasm
uses: ilammy/setup-nasm@v1
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: recursive
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-${{ env.CACHE_KEY}}-${{matrix.build_type}}
- name: Cache vcpkg artifacts
uses: actions/cache@v4
with:
path: ~/.ezvcpkg
key: vcpkg-${{ env.CACHE_KEY }}-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
vcpkg-${{ env.CACHE_KEY }}-${{ hashFiles('CMakeLists.txt') }}
vcpkg-${{ env.CACHE_KEY }}
- name: Set CC and CXX
if: ${{ matrix.compiler-cc }}
run: |
echo "CC=${{ matrix.compiler-cc }}" >> "$GITHUB_ENV"
echo "CXX=${{ matrix.compiler-cxx }}" >> "$GITHUB_ENV"
- name: Ceck compiler version
if: ${{ matrix.compiler-cc }}
run: |
${CC} --version
${CXX} --version
- name: Make more swap space available
if: ${{ matrix.platform != 'macos-15'}}
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-15' }}
run: |
echo "EXTRA_CMAKE_OPTIONS=-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64" >> "$GITHUB_ENV"
- name: Compile ${{matrix.build_type}} Configuration
run: |
cmake -B build -S . -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