-
-
Notifications
You must be signed in to change notification settings - Fork 640
921 lines (901 loc) · 38.4 KB
/
Copy pathlinux.yml
File metadata and controls
921 lines (901 loc) · 38.4 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
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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
name: Linux Build and Test
on:
push:
branches:
- 'main'
tags:
- 'v*'
paths-ignore:
- 'docs/**'
pull_request:
branches:
- '*'
paths-ignore:
- 'docs/**'
- '.github/workflows/docs_deploy.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
defaults:
run:
working-directory: cpp
jobs:
check-docker-changes:
name: Check Docker Changes
runs-on: ubuntu-24.04
outputs:
docker_changed: ${{ steps.set-any-changed.outputs.docker_changed }}
docker_tag: ${{ steps.set-docker-tag.outputs.docker_tag}}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed files
id: check-changes
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
with:
files: ../docker/**
since_last_remote_commit: true
- name: List all changed files
id: set-any-changed
run: |
echo "docker_changed=${{ steps.check-changes.outputs.any_changed }}" >> $GITHUB_OUTPUT
- name: Set docker tag
id: set-docker-tag
run: |
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ steps.check-changes.outputs.any_changed }}" = "true" ]; then
echo "docker_tag=pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "docker_tag=latest" >> $GITHUB_OUTPUT
fi
update-docker-images:
name: Update Docker Images
needs: check-docker-changes
if: needs.check-docker-changes.outputs.docker_changed == 'true'
uses: ./.github/workflows/docker.yml
secrets: inherit
ubuntu-debug:
name: Ubuntu 24.04 (Debug Build)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/debug/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(pwd)/build/debug/third_party/install" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -Bbuild/debug -H.
- name: build
run: cmake --build build/debug -j$(nproc)
- name: unit tests
run: ./build/debug/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/debug/src/system_tests/system_tests_runner
timeout-minutes: 15
ubuntu-asan:
name: Ubuntu 24.04 (AddressSanitizer)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/asan/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(pwd)/build/asan/third_party/install" >> $GITHUB_ENV
- name: configure
run: |
export CC=clang-19
export CXX=clang++-19
cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Debug -DASAN=ON -DWERROR=ON -Bbuild/asan -H.
- name: build
run: cmake --build build/asan -j$(nproc)
- name: unit tests
run: ./build/asan/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/asan/src/system_tests/system_tests_runner
timeout-minutes: 15
ubuntu-tsan:
name: Ubuntu 24.04 (ThreadSanitizer)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/tsan/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(pwd)/build/tsan/third_party/install" >> $GITHUB_ENV
- name: configure
run: |
export CC=clang-19
export CXX=clang++-19
cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Debug -DTSAN=ON -DWERROR=ON -Bbuild/tsan -H.
- name: build
run: cmake --build build/tsan -j$(nproc)
- name: unit tests
run: ./build/tsan/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/tsan/src/system_tests/system_tests_runner
timeout-minutes: 15
ubuntu-ubsan:
name: Ubuntu 24.04 (UndefinedBehaviour)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/ubsan/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(pwd)/build/ubsan/third_party/install" >> $GITHUB_ENV
- name: Install clang-19
run: sudo apt-get update && sudo apt-get install -y clang-19
- name: configure
run: |
export CC=clang-19
export CXX=clang++-19
cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Debug -DUBSAN=ON -DWERROR=ON -Bbuild/ubsan -H.
- name: build
run: cmake --build build/ubsan -j$(nproc)
- name: unit tests
run: ./build/ubsan/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/ubsan/src/system_tests/system_tests_runner
timeout-minutes: 15
ubuntu-superbuild:
name: ${{ matrix.description }}
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-${{ matrix.ubuntu_version }}:${{ needs.check-docker-changes.outputs.docker_tag }}
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
strategy:
fail-fast: false
matrix:
include:
- ubuntu_version: "24.04"
cc: gcc-13
cxx: g++-13
description: Ubuntu 24.04 (GCC 13)
- ubuntu_version: "24.04"
cc: gcc-14
cxx: g++-14
description: Ubuntu 24.04 (GCC 14)
- ubuntu_version: "24.04"
cc: clang-19
cxx: clang++-19
description: Ubuntu 24.04 (clang 19)
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- name: configure core dumps
run: |
ulimit -c unlimited
echo '/tmp/core.%h.%e.%t' | sudo tee /proc/sys/kernel/core_pattern
echo 'Core dump pattern set to:'
cat /proc/sys/kernel/core_pattern
- name: install dependencies for examples
run: |
sudo apt-get update && sudo apt-get install -y \
libsdl2-dev \
nlohmann-json3-dev
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/release/third_party/install
key: ${{ github.job }}-${{ matrix.ubuntu_version }}-${{ matrix.cc }}-${{ hashFiles('./cpp/third_party/**') }}-3
- 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: |
export CC=${{ matrix.cc }}
export CXX=${{ matrix.cxx }}
cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MAVSDK_SERVER=ON -DWERROR=ON -DCMAKE_INSTALL_PREFIX=install -Bbuild/release -H.
- name: build
run: cmake --build build/release -j$(nproc)
- name: install
run: cmake --build build/release --target install
- name: configure examples
run: cmake -DCMAKE_PREFIX_PATH="$(pwd)/install" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWERROR=ON -Bexamples/build -Hexamples
- name: build examples
run: cmake --build examples/build -j$(nproc)
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
env:
MALLOC_PERTURB_: "165"
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
timeout-minutes: 15
env:
MALLOC_PERTURB_: "165"
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: analyze core dumps
if: failure()
run: tools/analyze_core_dumps.sh build/release
- name: upload core dumps
if: failure()
uses: actions/upload-artifact@v7
with:
name: core-dumps-${{ matrix.description }}-${{ github.run_id }}
path: /tmp/core.*
retention-days: 7
if-no-files-found: ignore
- name: upload test binaries for core dump analysis
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-binaries-${{ matrix.description }}-${{ github.run_id }}
path: |
./cpp/build/src/unit_tests/unit_tests_runner
./cpp/build/release/src/system_tests/system_tests_runner
./cpp/build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
./cpp/build/release/src/mavsdk/libmavsdk.so*
./cpp/build/release/src/mavsdk_server/src/libmavsdk_server.so*
retention-days: 7
ubuntu-no-curl:
name: Ubuntu 24.04 (mavsdk, without curl)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: configure
run: |
cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MAVSDK_SERVER=OFF -DBUILD_WITHOUT_CURL=ON -DWERROR=ON -DCMAKE_INSTALL_PREFIX=install -Bbuild/release -H.
- name: build
run: cmake --build build/release -j$(nproc)
ubuntu-superbuild-off:
name: Ubuntu 24.04 (SUPERBUILD=OFF)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblzma-dev libtinyxml2-dev nlohmann-json3-dev libcurl4-openssl-dev libssl-dev libasio-dev libfmt-dev
- name: Build with system dependencies
run: ./tools/build-with-system-deps.sh
- name: unit tests
run: ./build-release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build-release/src/system_tests/system_tests_runner
timeout-minutes: 15
ubuntu24-style-and-proto-check:
name: ubuntu-24.04 (style and proto check)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Install tools
run: |
sudo apt-get update && sudo apt-get install -y \
python3-venv \
libasio-dev \
libfmt-dev \
nlohmann-json3-dev \
openjdk-21-jdk-headless
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/third_party/**') }}-4
restore-keys: |
ubuntu-superbuild-24.04-gcc-13-${{ hashFiles('./cpp/third_party/**') }}-
ubuntu-superbuild-
- name: disable superbuild on cache restore
run: |
if [ -f "build/release/third_party/install/bin/protoc" ]; then
echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV
echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
fi
- name: build necessary protoc tooling
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Debug -DBUILD_MAVSDK_SERVER=ON -Bbuild/release -H.
- name: generate code from protos
working-directory: .
run: PATH="$PATH:$HOME/.local/bin:$(pwd)/cpp/build/release/third_party/install/bin" tools/generate_from_protos.bash
- name: fix style
run: tools/fix_style.py . || true
- name: fix kotlin style
working-directory: kt/mavsdk-kotlin
run: ./gradlew ktfmtFormat --console=plain
- name: check for diff
run: git diff --exit-code
ubuntu24-docs-check:
name: ubuntu-24.04 (docs check)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-ubuntu-24.04:${{ needs.check-docker-changes.outputs.docker_tag }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- name: generate docs
run: tools/generate_docs.sh --overwrite
- name: check for diff
run: git diff --exit-code
deb-package:
name: ${{ matrix.os_name }} ${{ matrix.os_version }} (package, non-mavsdk_server)
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
container:
image: docker.io/mavsdk/mavsdk-${{ matrix.os_type }}-${{ matrix.os_version }}:${{ needs.check-docker-changes.outputs.docker_tag }}
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
strategy:
fail-fast: false
matrix:
include:
- os_type: ubuntu
os_name: Ubuntu
os_version: "22.04"
- os_type: ubuntu
os_name: Ubuntu
os_version: "24.04"
- os_type: debian
os_name: Debian
os_version: "11"
- os_type: debian
os_name: Debian
os_version: "12"
- os_type: debian
os_name: Debian
os_version: "13"
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- name: configure core dumps
run: |
ulimit -c unlimited
echo '/tmp/core.%h.%e.%t' | sudo tee /proc/sys/kernel/core_pattern
echo 'Core dump pattern set to:'
cat /proc/sys/kernel/core_pattern
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/release/third_party/install
key: ${{ github.job }}-${{ matrix.os_type }}-${{ matrix.os_version }}-${{ hashFiles('./cpp/third_party/**') }}-1
- 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: install asio (non-superbuild fallback)
if: steps.cache.outputs.cache-hit == 'true'
run: sudo apt-get update && sudo apt-get install -y libasio-dev
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=ON -Bbuild/release -H.
- name: build
run: cmake --build build/release -- -j$(nproc)
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
env:
MALLOC_PERTURB_: "165"
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
timeout-minutes: 15
env:
MALLOC_PERTURB_: "165"
- name: analyze core dumps
if: failure()
run: tools/analyze_core_dumps.sh build/release
- name: upload core dumps
if: failure()
uses: actions/upload-artifact@v7
with:
name: core-dumps-${{ matrix.os_type }}-${{ matrix.os_version }}-${{ github.run_id }}
path: /tmp/core.*
retention-days: 7
if-no-files-found: ignore
- name: upload test binaries for core dump analysis
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-binaries-${{ matrix.os_type }}-${{ matrix.os_version }}-${{ github.run_id }}
path: |
./cpp/build/release/src/unit_tests/unit_tests_runner
./cpp/build/release/src/system_tests/system_tests_runner
./cpp/build/release/src/system_tests/standalone_param_test
./cpp/build/release/src/system_tests/standalone_ftp_test
./cpp/build/release/src/mavsdk/libmavsdk.so*
./cpp/build/release/src/mavsdk_server/src/libmavsdk_server.so*
retention-days: 7
- name: install
run: cmake --build build/release --target install
- name: Package
if: startsWith(github.ref, 'refs/tags/v')
run: tools/create_packages.sh ./install . amd64 libmavsdk-dev
- name: Upload as artifact
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v7
with:
name: libmavsdk-dev-${{ matrix.os_type }}-${{ matrix.os_version }}
path: '*.deb'
retention-days: 2
- name: Publish artifacts
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
dockcross-linux:
name: linux-${{ matrix.docker_name }}
needs: [check-docker-changes, update-docker-images]
if: always() && needs.check-docker-changes.result == 'success'
runs-on: ubuntu-24.04
env:
ARG_IMAGE: docker.io/mavsdk/mavsdk-dockcross-linux-${{ matrix.docker_name }}-custom:${{ needs.check-docker-changes.outputs.docker_tag }}
OCI_EXE: docker
strategy:
fail-fast: false
matrix:
include:
- docker_name: armv6
arch_name: armv6
- docker_name: armv7
arch_name: armv7
- docker_name: arm64
arch_name: arm64
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
continue-on-error: true
- name: setup dockcross
run: |
for i in 1 2 3 4 5; do
docker run --rm ${{ env.ARG_IMAGE }} > ./dockcross-linux-${{ matrix.docker_name }}-custom && break
echo "::warning::docker run for dockcross image failed (attempt $i/5), retrying in 15s"
sleep 15
done
chmod +x ./dockcross-linux-${{ matrix.docker_name }}-custom
test -s ./dockcross-linux-${{ matrix.docker_name }}-custom
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/linux-${{ matrix.docker_name }}/third_party/install
key: ${{ github.job }}-linux-${{ matrix.docker_name }}-${{ hashFiles('./cpp/third_party/**') }}-3
- 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/linux-${{ matrix.docker_name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-linux-${{ matrix.docker_name }}-custom /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/linux-${{ matrix.docker_name }}/install -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DWERROR=ON -Bbuild/linux-${{ matrix.docker_name }} -H."
- name: build
run: ./dockcross-linux-${{ matrix.docker_name }}-custom cmake --build build/linux-${{ matrix.docker_name }} -j$(nproc) --target install
- name: create deb packages
if: startsWith(github.ref, 'refs/tags/v')
working-directory: .
run: ./cpp/dockcross-linux-${{ matrix.docker_name }}-custom cpp/tools/create_packages.sh ./cpp/build/linux-${{ matrix.docker_name }}/install . ${{ matrix.arch_name }} libmavsdk-dev
- if: startsWith(github.ref, 'refs/tags/v') && matrix.rename_distro
name: Rename LTS versions from debian12 to debian11
run: |
sudo apt update && sudo apt install -y \
rename
rename 's/debian12_arm64/debian11_arm64/' *.deb
- name: Publish artifacts
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.19.0 (musl)
runs-on: ubuntu-24.04
container: alpine:3.19.0
steps:
- name: install tools
working-directory: .
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-pip rust cargo
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: git get version tags
run: git fetch --tags
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./cpp/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=$(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=ON -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j$(nproc)
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
timeout-minutes: 15
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: build C wrapper
working-directory: ./c
run: |
cmake -DCMAKE_INSTALL_PREFIX=build/install -DCMAKE_PREFIX_PATH="$(pwd)/../cpp/install;$(pwd)/../cpp/build/release/third_party/install" -DBUILD_SHARED_LIBS=ON -Bbuild -S.
cmake --build build --target install
- name: Upload as artifact
uses: actions/upload-artifact@v7
with:
name: mavsdk_server_musl_x86_64
path: ./cpp/install/bin/mavsdk_server
retention-days: 2
- name: Upload C wrapper as artifact
uses: actions/upload-artifact@v7
with:
name: libcmavsdk_musl_x86_64
path: ./c/build/install/lib/
retention-days: 2
- name: Publish artifacts
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-24.04
env:
OCI_EXE: docker
strategy:
fail-fast: false
matrix:
arch_name: [linux-armv6-musl, linux-armv7l-musl, linux-arm64-musl]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: setup dockcross
run: |
for i in 1 2 3 4 5; do
docker run --rm dockcross/${{ matrix.arch_name }}:20250818-0a27819 > ./dockcross-${{ matrix.arch_name }} && break
echo "::warning::docker run for dockcross image failed (attempt $i/5), retrying in 15s"
sleep 15
done
chmod +x ./dockcross-${{ matrix.arch_name }}
test -s ./dockcross-${{ matrix.arch_name }}
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/${{ matrix.arch_name }}/third_party/install
key: ${{ github.job }}-${{ matrix.arch_name }}-${{ hashFiles('./cpp/third_party/**') }}-3
- 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.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=ON -Bbuild/${{ matrix.arch_name }} -H."
- name: build
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/${{ matrix.arch_name }} -j$(nproc) --target install
- name: Upload as artifact
uses: actions/upload-artifact@v7
with:
name: mavsdk_server_${{ matrix.arch_name }}
path: 'cpp/build/${{ matrix.arch_name }}/install/bin/mavsdk_server'
retention-days: 2
- name: Publish artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'cpp/build/${{ matrix.arch_name }}/install/bin/mavsdk_server'
asset_name: 'mavsdk_server_${{ matrix.arch_name }}'
tag: ${{ github.ref }}
overwrite: true
dockcross-manylinux:
name: ${{ matrix.arch_name }}
runs-on: ubuntu-24.04
env:
OCI_EXE: docker
strategy:
fail-fast: false
matrix:
include:
- arch_name: manylinux_2_28-x64
artifact_arch: x86_64
python_exec: /opt/python/cp39-cp39/bin/python3
python_exec_pip: /opt/python/cp39-cp39/bin/pip
python_exec_auditwheel: /opt/python/cp39-cp39/bin/python3
python_plat_name_arg: ""
auditwheel_plat: manylinux_2_28_x86_64
- arch_name: manylinux2014-aarch64
artifact_arch: aarch64
python_exec: /opt/python/cp39-cp39-xc/bin/build-python3
python_exec_pip: /opt/python/cp39-cp39-xc/bin/build-pip
python_exec_auditwheel: /opt/python/cp39-cp39-xc/bin/cross-python3
python_plat_name_arg: "--plat-name linux_aarch64"
auditwheel_plat: manylinux2014_aarch64
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: setup dockcross
working-directory: .
run: |
for i in 1 2 3 4 5; do
docker run --rm dockcross/${{ matrix.arch_name }}:latest > ./dockcross-${{ matrix.arch_name }} && break
echo "::warning::docker run for dockcross image failed (attempt $i/5), retrying in 15s"
sleep 15
done
chmod +x ./dockcross-${{ matrix.arch_name }}
test -s ./dockcross-${{ matrix.arch_name }}
- uses: actions/cache@v5
id: cache
with:
path: ./build/manylinux/cpp/third_party/install
key: ${{ github.job }}-${{ matrix.arch_name }}-${{ hashFiles('./cpp/third_party/**') }}-2
- 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/manylinux/cpp/third_party/install" >> $GITHUB_ENV
- name: configure cpp
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} /bin/bash -c "sudo yum install -y perl-core && cmake $superbuild $cmake_prefix_path -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=build/manylinux/cpp/install -DBUILD_MAVSDK_SERVER=OFF -Bbuild/manylinux/cpp -Scpp"
- name: build cpp
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/manylinux/cpp -j$(nproc) --target install
- name: configure c
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} cmake -DCMAKE_INSTALL_PREFIX=build/manylinux/c/install -DCMAKE_PREFIX_PATH="/work/build/manylinux/cpp/install;/work/build/manylinux/cpp/third_party/install" -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUNDLE_STATIC_RUNTIME=ON -Bbuild/manylinux/c -Sc
- name: build c
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/manylinux/c -j$(nproc) --target install
- name: upload libcmavsdk artifact
uses: actions/upload-artifact@v7
with:
name: libcmavsdk_${{ matrix.arch_name }}
path: 'build/manylinux/c/install/lib/libcmavsdk.so'
retention-days: 2
- name: build mavsdk wheel
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} bash -c "
sudo ${{ matrix.python_exec_pip }} install -r /work/py/requirements-dev.txt auditwheel &&
sudo ${{ matrix.python_exec_auditwheel }} -m pip install auditwheel &&
mkdir -p /work/py/mavsdk/mavsdk/lib &&
cp /work/build/manylinux/c/install/lib/libcmavsdk.so /work/py/mavsdk/mavsdk/lib/libcmavsdk.so &&
cd /work/py/mavsdk &&
${{ matrix.python_exec }} setup.py bdist_wheel ${{ matrix.python_plat_name_arg }} &&
sudo ${{ matrix.python_exec_auditwheel }} -m auditwheel repair --plat ${{ matrix.auditwheel_plat }} dist/mavsdk4-*-linux_*.whl"
- name: upload mavsdk wheel
uses: actions/upload-artifact@v7
with:
name: mavsdk_wheel_${{ matrix.arch_name }}
path: py/mavsdk/wheelhouse/*.whl
retention-days: 2
# aiomavsdk is pure Python (py3-none-any), only needs to be built once
- name: build aiomavsdk wheel
if: matrix.artifact_arch == 'x86_64'
working-directory: .
run: ./dockcross-${{ matrix.arch_name }} bash -c "
sudo ${{ matrix.python_exec_pip }} install -r /work/py/requirements-dev.txt &&
cd /work/py/aiomavsdk &&
${{ matrix.python_exec }} setup.py bdist_wheel"
- name: upload aiomavsdk wheel
if: matrix.artifact_arch == 'x86_64'
uses: actions/upload-artifact@v7
with:
name: aiomavsdk_wheel
path: py/aiomavsdk/dist/*.whl
retention-days: 2
dockcross-android:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
env:
OCI_EXE: docker
strategy:
fail-fast: false
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@v6
with:
submodules: recursive
fetch-depth: 0
- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
continue-on-error: true
- name: setup dockcross
run: |
for i in 1 2 3 4 5; do
docker run --rm dockcross/${{ matrix.name }}:20250818-0a27819 > ./dockcross-${{ matrix.name }} && break
echo "::warning::docker run for dockcross image failed (attempt $i/5), retrying in 15s"
sleep 15
done
chmod +x ./dockcross-${{ matrix.name }}
test -s ./dockcross-${{ matrix.name }}
- uses: actions/cache@v5
id: cache
with:
path: ./cpp/build/${{ matrix.name }}/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./cpp/third_party/**') }}-3
- 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: configure
run: ./dockcross-${{ matrix.name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=build/${{ matrix.name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=ON -Bbuild/${{ matrix.name }} -H."
- name: build
run: ./dockcross-${{ matrix.name }} cmake --build build/${{ matrix.name }} -j$(nproc) --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 }}/install/include/mavsdk/mavsdk_export.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: Upload as artifact
uses: actions/upload-artifact@v7
with:
name: mavsdk_server_${{ matrix.name }}.tar
path: 'cpp/build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar'
retention-days: 2
- name: Publish artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'cpp/build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar'
asset_name: 'mavsdk_server_${{ matrix.name }}.tar'
tag: ${{ github.ref }}
overwrite: true