forked from maplibre/maplibre-native
-
Notifications
You must be signed in to change notification settings - Fork 0
215 lines (199 loc) · 6.71 KB
/
qt-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
name: qt-ci
on:
workflow_dispatch:
push:
tags-ignore:
- '**'
paths-ignore:
- ".gitignore"
- "README.md"
# ignore other platforms
- "platform/android/**"
- "platform/darwin/**"
- "platform/glfw/**"
- "platform/ios/**"
- "platform/macos/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/workflows/android-ci.yml"
- ".github/workflows/android-ci-pull.yml"
- ".github/workflows/android-docker-base.yml"
- ".github/workflows/android-docker-ndk-r21b.yml"
- ".github/workflows/gh-pages-android-api.yml"
- ".github/workflows/gh-pages-ios-api.yml"
- ".github/workflows/ios-ci.yml"
- ".github/workflows/ios-pre-release.yml"
- ".github/workflows/ios-release.yml"
- ".github/workflows/macos-ci.yml"
- ".github/workflows/macos-release.yml"
- ".github/workflows/node-ci.yml"
- ".github/workflows/qt-ci-windows.yml"
- ".github/workflows/update-gl-js.yml"
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- ".gitignore"
- "README.md"
# ignore other platforms
- "platform/android/**"
- "platform/darwin/**"
- "platform/glfw/**"
- "platform/ios/**"
- "platform/macos/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/workflows/android-ci.yml"
- ".github/workflows/android-ci-pull.yml"
- ".github/workflows/android-docker-base.yml"
- ".github/workflows/android-docker-ndk-r21b.yml"
- ".github/workflows/gh-pages-android-api.yml"
- ".github/workflows/gh-pages-ios-api.yml"
- ".github/workflows/ios-ci.yml"
- ".github/workflows/ios-pre-release.yml"
- ".github/workflows/ios-release.yml"
- ".github/workflows/macos-ci.yml"
- ".github/workflows/macos-release.yml"
- ".github/workflows/node-ci.yml"
- ".github/workflows/qt-ci-windows.yml"
- ".github/workflows/update-gl-js.yml"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build-core:
strategy:
matrix:
include:
- name: Linux
os: ubuntu-latest
static: OFF
qt: 5.15.2
qt_target: desktop
- name: macOS
os: macos-latest
static: OFF
qt: 5.15.2
qt_target: desktop
- name: macOS_static
os: macos-latest
static: ON
qt: 5.15.2
qt_target: desktop
- name: iOS_static
os: macos-latest
static: ON
qt: 5.15.2
qt_target: ios
- name: macOS
os: macos-latest
static: ON
qt: 6.2.2
qt_target: desktop
- name: macOS_static
os: macos-latest
static: OFF
qt: 6.2.2
qt_target: desktop
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: RelWithDebInfo
BUILD_MODE: ${{ matrix.static }}
QT_VERSION: ${{ matrix.qt }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: source
submodules: recursive
fetch-depth: 0
- name: Install macOS dependencies
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew list cmake || brew install cmake
brew list ccache || brew install ccache
brew list ninja || brew install ninja
- name: Setup Xcode
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Download Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}
target: ${{ matrix.qt_target }}
- name: Prepare ccache
if: runner.os == 'macOS'
run: |
ccache --clear
ccache --set-config cache_dir=~/.ccache
- name: Cache ccache
uses: actions/cache@v2
env:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.name }}-${{ matrix.qt }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.name }}-${{ matrix.qt }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.name }}-${{ matrix.qt }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.name }}-${{ matrix.qt }}-${{ github.job }}
- name: Clear ccache statistics
if: runner.os == 'macOS'
run: |
ccache --zero-stats
ccache --max-size=2G
ccache --show-stats -v
- name: Build maplibre-gl-native (macOS)
if: runner.os == 'macOS' && matrix.qt_target == 'desktop'
run: |
mkdir build && cd build
cmake ../source/ \
-G Ninja \
-DMBGL_WITH_QT=ON \
-DMBGL_QT_STATIC=${BUILD_MODE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
ninja
ninja install
- name: Build maplibre-gl-native (iOS)
if: runner.os == 'macOS' && matrix.qt_target == 'ios'
run: |
mkdir build && cd build
cmake ../source/ \
-G"Ninja Multi-Config" \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DMBGL_WITH_QT=ON \
-DMBGL_QT_STATIC=${BUILD_MODE} \
-DMBGL_QT_LIBRARY_ONLY=ON \
-DMBGL_QT_WITH_IOS_CCACHE=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_FIND_ROOT_PATH="$Qt5_Dir" \
-DCMAKE_PREFIX_PATH="$Qt5_Dir"
cmake --build . --config Release
cmake --install . --config Release
- name: Build maplibre-gl-native (Linux)
if: runner.os == 'Linux'
uses: ./source/.github/actions/qt5-build
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt }}
path: install
- name: Show ccache statistics
if: runner.os == 'macOS'
run: |
ccache --show-stats -v