Support MAVLink 32 bit sysid #1565
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - 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: 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 | |
| - name: system tests | |
| run: ./build/release/src/system_tests/system_tests_runner | |
| timeout-minutes: 15 | |
| - 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 |