-
Notifications
You must be signed in to change notification settings - Fork 1
350 lines (303 loc) · 12 KB
/
Copy pathci.yml
File metadata and controls
350 lines (303 loc) · 12 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
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
name: CI
on:
workflow_call:
schedule:
- cron: "0 7 * * 1"
push:
branches:
- '*'
- '!main'
- '!beta'
- '!alpha'
permissions:
contents: read
jobs:
libxml2:
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Configure build tools
run: |
cd thirdparty/libxml2
# omit the auto included configure step
NOCONFIGURE=1 ./autogen.sh
emconfigure ./configure --disable-shared --prefix=$GITHUB_WORKSPACE/dist \
--with-http=no --with-python=no --with-threads=no --with-zlib=no \
--with-modules=no --with-c14n=no --with-catalog=no --with-debug=no \
--with-html=no --with-iconv=no --with-iso8859x=no --with-legacy=no \
--with-push=no --with-reader=no --with-readline=no --with-regexps=no \
--with-valid=no --with-writer=no --with-xinclude=no --with-lzma=no \
--with-schematron=no --with-schemas=yes
- name: Start compilation
run: |
cd thirdparty/libxml2
emmake make install -j$(nproc)
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: libxml2
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
SQLite:
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Configure build tools
run: |
cd thirdparty/sqlite
git apply ../../patches/sqlite_fix_build.patch
export OPT_FEATURE_FLAGS="-DSQLITE_UNTESTABLE -DSQLITE_OMIT_SHARED_CACHE \
-DSQLITE_OMIT_AUTOVACUUM -DSQLITE_OMIT_BLOB_LITERAL -DSQLITE_OMIT_CHECK -DSQLITE_OMIT_COMPILEOPTION_DIAGS \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FLAG_PRAGMAS \
-DSQLITE_OMIT_GENERATED_COLUMNS -DSQLITE_OMIT_HEX_INTEGER -DSQLITE_OMIT_INTEGRITY_CHECK -DSQLITE_OMIT_INTROSPECTION_PRAGMAS \
-DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRUNCATE_OPTIMIZATION -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_AUTHORIZATION"
export CFLAGS="-DSQLITE_ENABLE_RTREE -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA $OPT_FEATURE_FLAGS"
emconfigure ./configure --disable-threadsafe --disable-shared --prefix=$GITHUB_WORKSPACE/dist
- name: Start compilation
run: |
cd thirdparty/sqlite
# build amalgamation
emmake make sqlite3.c
emmake make install -j$(nproc)
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: SQLite
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
GEOS:
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Configure build tools
run: |
cd thirdparty/geos
git apply ../../patches/geos_fix_build.patch
mkdir -p build && cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dist -DBUILD_TESTING=OFF ..
- name: Start compilation
run: |
cd thirdparty/geos/build
emmake make install -j$(nproc)
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: GEOS
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
PROJ:
needs: [SQLite]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Restore previous build artifacts
uses: actions/download-artifact@v8.0.1
with:
name: SQLite
path: dist/
- name: Configure build tools
run: |
cd thirdparty/PROJ
git apply ../../patches/proj_fix_build.patch
mkdir -p build && cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_FLAGS=-fwasm-exceptions \
-DBUILD_TESTING=OFF -DSQLite3_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include \
-DSQLite3_LIBRARY=$GITHUB_WORKSPACE/dist/libsqlite3.a -DEXE_SQLITE3=$GITHUB_WORKSPACE/dist/bin \
-DENABLE_TIFF=OFF -DENABLE_CURL=OFF -DBUILD_APPS=OFF -DEMBED_RESOURCE_FILES=OFF \
-DCMAKE_C_IMPLICIT_LINK_LIBRARIES=" " -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dist -DBUILD_TESTING=OFF ..
- name: Start compilation
run: |
cd thirdparty/PROJ/build
emmake make install -j$(nproc)
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: PROJ
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
GDAL:
needs: [SQLite, PROJ]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Restore previous build artifacts
uses: actions/download-artifact@v8.0.1
with:
pattern: '{SQLite,PROJ}'
path: dist/
merge-multiple: true
- name: Configure build tools
run: |
cd thirdparty/gdal
# trigger port loading
EM_DATA=$EMSDK/upstream/emscripten
EM_CACHE=$EM_DATA/cache
touch temp.c
emcc -c -s SUPPORT_LONGJMP=wasm -s USE_ZLIB=1 -s USE_LIBPNG=1 -s USE_LIBJPEG=1 temp.c
git apply ../../patches/gdal_reduce_size.patch
mkdir -p build && cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/dist \
-DCMAKE_CXX_FLAGS="-s SUPPORT_LONGJMP=wasm" -DCMAKE_C_FLAGS="-s SUPPORT_LONGJMP=wasm" \
-DPROJ_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include -DPROJ_LIBRARY=$GITHUB_WORKSPACE/dist/lib/libproj.a \
-DSQLite3_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include -DSQLite3_LIBRARY=$GITHUB_WORKSPACE/dist/lib/libsqlite3.a \
-DPNG_LIBRARY=$EM_CACHE/sysroot/lib/wasm32-emscripten/libpng-wasm-sjlj.a \
-DGDAL_USE_ICONV=OFF -DGDAL_USE_INTERNAL_LIBS=OFF -DENABLE_GNM=OFF -DENABLE_PAM=OFF -DACCEPT_MISSING_SQLITE3_MUTEX_ALLOC=ON \
-DGDAL_USE_JSONC_INTERNAL=ON -DBUILD_APPS=OFF -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dist -DBUILD_TESTING=OFF ..
- name: Start compilation
run: |
cd thirdparty/gdal/build
emmake make install -j$(nproc)
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: GDAL
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
MapServer:
needs: [GDAL, GEOS, PROJ, libxml2]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Restore previous build artifacts
uses: actions/download-artifact@v8.0.1
with:
pattern: '{GDAL,GEOS,PROJ,libxml2}'
path: dist/
merge-multiple: true
- name: Configure build tools
run: |
cd thirdparty/mapserver
# trigger port loading
EM_DATA=$EMSDK/upstream/emscripten
EM_CACHE=$EM_DATA/cache
touch temp.c
emcc -c -s SUPPORT_LONGJMP=wasm -s USE_ZLIB=1 -s USE_FREETYPE=1 -s USE_LIBPNG=1 -s USE_LIBJPEG=1 temp.c
mkdir -p build && cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DWITH_FRIBIDI=OFF -DWITH_HARFBUZZ=OFF -DWITH_ICONV=OFF -DWITH_CAIRO=OFF -DWITH_FCGI=OFF \
-DWITH_POSTGIS=OFF -DWITH_WCS=OFF -DWITH_GIF=OFF -DWITH_PROTOBUFC=OFF -DCMAKE_C_FLAGS="-s SUPPORT_LONGJMP=wasm" \
-DFREETYPE_INCLUDE_DIR=$EM_CACHE/sysroot/include/freetype2 -DFREETYPE_LIBRARY=$EM_CACHE/sysroot/lib/wasm32-emscripten \
-DJPEG_INCLUDE_DIR=$EM_CACHE/sysroot/include -DJPEG_LIBRARY=$EM_CACHE/sysroot/lib/wasm32-emscripten \
-DPNG_INCLUDE_DIR=$EM_CACHE/sysroot/include -DPNG_LIBRARY=$EM_CACHE/sysroot/lib/wasm32-emscripten \
-DZLIB_INCLUDE_DIR=$EM_CACHE/sysroot/include -DZLIB_LIBRARY=$EM_CACHE/sysroot/lib/wasm32-emscripten \
-DPROJ_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include -DPROJ_LIBRARY=$GITHUB_WORKSPACE$GITHUB_WORKSPACE/dist/lib \
-DLIBXML2_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include/libxml2 -DLIBXML2_LIBRARY=$GITHUB_WORKSPACE/dist/lib \
-DGDAL_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include -DGDAL_LIBRARY=$GITHUB_WORKSPACE/dist/lib \
-DGEOS_INCLUDE_DIR=$GITHUB_WORKSPACE/dist/include -DGEOS_LIBRARY=$GITHUB_WORKSPACE/dist/lib ..
- name: Start compilation
run: |
cd thirdparty/mapserver/build
emmake make mapserver -j$(nproc) # build mapserver.a target only
- name: Install artifacts
run: |
cd thirdparty/mapserver/build
cp libmapserver.a $GITHUB_WORKSPACE/dist/lib
cp *.h $GITHUB_WORKSPACE/dist/include
cp ../src/*.h $GITHUB_WORKSPACE/dist/include
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: MapServer
path: dist/
if-no-files-found: error
retention-days: 1
overwrite: true
WASM:
needs: [MapServer]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Restore previous build artifacts
uses: actions/download-artifact@v8.0.1
with:
name: MapServer
path: dist/
- name: Install required tools
run: sudo apt-get update && sudo apt-get install -y brotli
- name: Start compilation
run: emmake make
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: WASM
path: |
dist/mapserver.*
dist/mapserver-node.js
if-no-files-found: error
retention-days: 1
overwrite: true
Vitest:
needs: [WASM]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Prepare build environemnt
uses: ./.github/actions/prepare-build-env
- name: Restore previous build artifacts
uses: actions/download-artifact@v8.0.1
with:
name: WASM
path: dist/
- name: Install npm dependencies
run: npm ci
- name: Run jest tests
run: npm test