forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
581 lines (563 loc) · 25.2 KB
/
main.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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
name: Build and Test
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
coverage:
name: coverage (ubuntu-20.04)
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/third_party/install" >> $GITHUB_ENV
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y lcov python3-future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Coverage -DASAN=ON -DWERROR=OFF -Bbuild -H.
- name: build
run: cmake --build build -j2
- name: unit tests
run: ./build/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/src/system_tests/system_tests_runner
- name: run lcov
run: lcov --capture --directory . --no-external --exclude "*/third_party/*" --output-file lcov.info
- name: check size of lcov.info
run: |
ls -l lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"
ubuntu20-non-superbuild:
name: ubuntu-20.04 (non-mavsdk_server, non-superbuild)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install
run: sudo apt-get update && sudo apt-get install -y libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=OFF -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
ubuntu-superbuild:
name: ${{ matrix.ubuntu_image }} (mavsdk_server, superbuild)
runs-on: ${{ matrix.ubuntu_image }}
strategy:
matrix:
ubuntu_image: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ matrix.ubuntu_image }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release -j2
- name: install
run: sudo cmake --build build/release --target install
- name: temporary workaround for Ubuntu 22.04
if: ${{ matrix.ubuntu_image }} == "ubuntu-22.04"
run: |
echo 'APT::Get::Always-Include-Phased-Updates "true";' | sudo tee -a /etc/apt/apt.conf.d/99-phased-updates
sudo apt-get update
- name: install examples dependencies
run: sudo apt-get install libsdl2-dev
- name: configure examples
run: cmake -DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -Bexamples/build -Hexamples
- name: build examples
run: cmake --build examples/build -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
ubuntu20-hunter:
name: ubuntu-20.04 (mavsdk, hunter)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ~/.hunter
key: ${{ github.job }}-${{ hashFiles('~/.hunter/**') }}
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: configure
run: cmake -DSUPERBUILD=OFF -DHUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=$(pwd)/src/cmake/fpic_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=OFF -Bbuild -H.
- name: build
run: cmake --build build -j2
- name: unit tests
run: ./build/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/src/system_tests/system_tests_runner
ubuntu20-proto-check:
name: ubuntu-22.04 (proto check)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y clang-format-12
- uses: actions/cache@v3
id: cache
with:
path: ./build/default/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/default/third_party/install" >> $GITHUB_ENV
- name: build necessary protoc tooling
run: cmake $superbuild $cmake_prefix_path -DBUILD_MAVSDK_SERVER=ON -Bbuild/default -H.
- name: generate code from protos
run: PATH="$PATH:$HOME/.local/bin" tools/generate_from_protos.sh
- name: fix style
run: tools/fix_style.sh . || true
- name: check for diff
run: git diff --exit-code
ubuntu20-check-style:
name: ubuntu-22.04 (check style and docs)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen clang-format-12
- name: check style
run: ./tools/fix_style.sh .
- name: check docs
run: tools/generate_docs.sh
deb-package:
name: ${{ matrix.container_name }} (package, non-mavsdk_server)
runs-on: ubuntu-20.04
container: mavsdk/mavsdk-${{ matrix.container_name }}
strategy:
matrix:
container_name: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j2
- name: Package
if: startsWith(github.ref, 'refs/tags/v')
run: tools/create_packages.sh ./install . amd64 libmavsdk-dev
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: '*.deb'
tag: ${{ github.ref }}
overwrite: true
debian-packaging:
name: Ubuntu/Debian packaging (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: install packages
run: sudo apt-get update && sudo apt-get install -y build-essential debhelper fakeroot libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev libjsoncpp1 libcurl4 libtinyxml2-6a
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: generate changelog
run: ./tools/generate_debian_changelog.sh > debian/changelog
- name: Build package
run: dpkg-buildpackage -us -uc -b
dockcross-linux-arm:
name: linux-${{ matrix.arch_name }}
runs-on: ubuntu-20.04
strategy:
matrix:
arch_name: [armv6, armv7, arm64]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm mavsdk/mavsdk-dockcross-linux-${{ matrix.arch_name }}-custom > ./dockcross-linux-${{ matrix.arch_name }}-custom; chmod +x ./dockcross-linux-${{ matrix.arch_name }}-custom
- uses: actions/cache@v3
id: cache
with:
path: ./build/linux-${{ matrix.arch_name }}/third_party/install
key: ${{ github.job }}-linux-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }}-4
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/linux-${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-linux-${{ matrix.arch_name }}-custom /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/linux-${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DWERROR=OFF -Bbuild/linux-${{ matrix.arch_name }} -H."
- name: build
run: ./dockcross-linux-${{ matrix.arch_name }}-custom cmake --build build/linux-${{ matrix.arch_name }} -j2 --target install
- name: create deb packages
run: ./dockcross-linux-${{ matrix.arch_name }}-custom tools/create_packages.sh ./build/linux-${{ matrix.arch_name }}/install . ${{ matrix.arch_name }} libmavsdk-dev
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: '*.deb'
tag: ${{ github.ref }}
overwrite: true
alpine-linux:
name: alpine 3.16.0 (musl)
runs-on: ubuntu-20.04
container: alpine:3.16.0
steps:
- name: install tools
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-pip
- uses: actions/checkout@v3
with:
submodules: recursive
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: Upload as artefact
uses: actions/upload-artifact@v3
with:
name: mavsdk_server_musl_x86_64
path: ./install/bin/mavsdk_server
retention-days: 2
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'install/bin/mavsdk_server'
asset_name: 'mavsdk_server_musl_x86_64'
tag: ${{ github.ref }}
overwrite: true
dockcross-linux-musl:
name: ${{ matrix.arch_name }}
runs-on: ubuntu-20.04
strategy:
matrix:
arch_name: [linux-armv6-musl, linux-armv7l-musl, linux-arm64-musl]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.arch_name }} > ./dockcross-${{ matrix.arch_name }}; chmod +x ./dockcross-${{ matrix.arch_name }}
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.arch_name }}/third_party/install
key: ${{ github.job }}-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-${{ matrix.arch_name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/${{ matrix.arch_name }} -H."
- name: build
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/${{ matrix.arch_name }} -j2 --target install
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/${{ matrix.arch_name }}/install/bin/mavsdk_server'
asset_name: 'mavsdk_server_${{ matrix.arch_name }}'
tag: ${{ github.ref }}
overwrite: true
dockcross-android:
name: ${{ matrix.name }}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- name: android-arm
arch: armeabi-v7a
- name: android-arm64
arch: arm64-v8a
- name: android-x86
arch: x86
- name: android-x86_64
arch: x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.name }} > ./dockcross-${{ matrix.name }}; chmod +x ./dockcross-${{ matrix.name }}
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.name }}/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-${{ matrix.name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H."
- name: build
run: ./dockcross-${{ matrix.name }} cmake --build build/${{ matrix.name }} -j2 --target install
- name: create tar with header and library
run: mkdir -p build/${{ matrix.name }}/export/include; cp build/${{ matrix.name }}/install/include/mavsdk/mavsdk_server/mavsdk_server_api.h build/${{ matrix.name }}/export/include; mkdir -p build/${{ matrix.name }}/export/${{ matrix.arch }}; cp build/${{ matrix.name }}/install/lib/libmavsdk_server.so build/${{ matrix.name }}/export/${{ matrix.arch }}; tar -C build/${{ matrix.name }}/export -cf build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar ${{ matrix.arch }} include;
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar'
asset_name: 'mavsdk_server_${{ matrix.name }}.tar'
tag: ${{ github.ref }}
overwrite: true
macOS:
name: ${{ matrix.name }}
runs-on: macos-12
strategy:
matrix:
include:
- name: macOS
build-framework: OFF
- name: macOS-framework
build-framework: ON
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v3
id: cache
with:
path: ./build/macos/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/macos/third_party/install" >> $GITHUB_ENV
- name: set SDKROOT value
run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/macos/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DMACOS_FRAMEWORK=${{ matrix.build-framework }} -DWERROR=OFF -Bbuild/macos -H.
- name: build
run: cmake --build build/macos -j2 --target install
- name: unit tests
run: ./build/macos/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/macos/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/macos/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: Upload framework as artefact
if: ${{ matrix.build-framework == 'ON' }}
uses: actions/upload-artifact@v3
with:
name: mavsdk_server_macos.framework
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework
retention-days: 2
- name: Publish mavsdk_server_macos to github release
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.build-framework == 'OFF' }}
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/macos/install/bin/mavsdk_server'
asset_name: 'mavsdk_server_macos'
tag: ${{ github.ref }}
overwrite: true
iOS:
name: ${{ matrix.name }}
runs-on: macos-12
strategy:
matrix:
include:
- name: ios
platform: OS64
sdk: iphoneos
- name: ios_simulator
platform: SIMULATOR64
sdk: iphonesimulator
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.name }}/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**', './tools/ios.toolchain.cmake') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV
- name: set SDK-related environment variables (for non-cmake deps)
run: |
echo "SDKROOT=$(xcrun --sdk ${{ matrix.sdk }} --show-sdk-path)" >> $GITHUB_ENV
- name: install pymavlink dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DENABLE_STRICT_TRY_COMPILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(pwd)/tools/ios.toolchain.cmake -DENABLE_BITCODE=Off -DPLATFORM=${{ matrix.platform }} -DDEPLOYMENT_TARGET=14.0 -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H.
- name: build
run: cmake --build build/${{ matrix.name }} -j2
- uses: actions/upload-artifact@v3
with:
name: mavsdk_server_${{ matrix.name }}.framework
path: ./build/${{ matrix.name }}/src/mavsdk_server/src/mavsdk_server.framework
retention-days: 2
iOS-XCFramework:
name: iOS XCFramework
needs: [macOS, iOS]
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_ios.framework
path: ./build/ios/src/mavsdk_server/src/mavsdk_server.framework
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_ios_simulator.framework
path: ./build/ios_simulator/src/mavsdk_server/src/mavsdk_server.framework
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_macos.framework
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework
- name: Package
run: bash ./src/mavsdk_server/tools/package_mavsdk_server_framework.bash
- uses: actions/upload-artifact@v3
with:
name: mavsdk_server.xcframework
path: ./build/mavsdk_server.xcframework
retention-days: 2
- name: Publish xcframework
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/mavsdk_server.xcframework.zip'
asset_name: 'mavsdk_server.xcframework.zip'
tag: ${{ github.ref }}
overwrite: true
- name: Publish xcframework checksum
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/mavsdk_server.xcframework.zip.sha256'
asset_name: 'mavsdk_server.xcframework.zip.sha256'
tag: ${{ github.ref }}
overwrite: true
Windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}-2
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: |
echo "superbuild=-DSUPERBUILD=OFF" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: install packages
run: |
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: configure
run: cmake -G "Visual Studio 17 2022" $env:superbuild $env:cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/release/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/release -S.
- name: build
run: cmake --build build/release -j2 --config Release --target install
- name: Create zip file mavsdk libraries
if: startsWith(github.ref, 'refs/tags/v')
run: cd build/release/install && 7z.exe a -tzip ../../../mavsdk-windows-x64-release.zip . && cd ../../..
- name: Publish mavsdk libraries
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'mavsdk-windows-x64-release.zip'
asset_name: 'mavsdk-windows-x64-release.zip'
tag: ${{ github.ref }}
overwrite: true
- name: Publish mavsdk_server binary
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/release/install/bin/mavsdk_server_bin.exe'
asset_name: 'mavsdk_server_win32.exe'
tag: ${{ github.ref }}
overwrite: true