Skip to content

core: speed up deserialization using std::to_chars #455

core: speed up deserialization using std::to_chars

core: speed up deserialization using std::to_chars #455

Workflow file for this run

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:
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@v4
with:
fetch-depth: 0
- name: Get changed files
id: check-changes
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
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
coverage:
# Use 22.04 for now because 24.04 throws a 'ERROR: mismatched end line ...'
name: Coverage (ubuntu-22.04)
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-22.04:${{ needs.check-docker-changes.outputs.docker_tag }}
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@v4
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@v4
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 lcov
run: |
sudo apt-get update && sudo apt-get install -y \
lcov \
curl
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Coverage -DWERROR=ON -Bbuild -H.
- name: build
run: cmake --build build -j$(nproc)
- name: unit tests
run: ./build/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/src/system_tests/system_tests_runner
- name: upload core dumps
if: failure()
uses: actions/upload-artifact@v4
with:
name: core-dumps-coverage-${{ github.run_id }}
path: /tmp/core.*
retention-days: 7
if-no-files-found: ignore
- name: upload test binary for core dump analysis
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-binary-coverage-${{ github.run_id }}
path: |
./build/src/unit_tests/unit_tests_runner
./build/src/system_tests/system_tests_runner
./build/src/mavsdk/libmavsdk.so*
./build/src/mavsdk_server/src/libmavsdk_server.so*
retention-days: 7
- 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@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"
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@v4
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@v4
id: cache
with:
path: ./build/debug/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/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
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@v4
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@v4
id: cache
with:
path: ./build/asan/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" >> $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
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@v4
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@v4
id: cache
with:
path: ./build/tsan/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" >> $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
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@v4
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@v4
id: cache
with:
path: ./build/ubsan/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" >> $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
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@v4
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
- uses: actions/cache@v4
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ matrix.ubuntu_version }}-${{ matrix.cc }}-${{ 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: |
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
- 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@v4
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@v4
with:
name: test-binaries-${{ matrix.description }}-${{ github.run_id }}
path: |
./build/src/unit_tests/unit_tests_runner
./build/release/src/system_tests/system_tests_runner
./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
./build/release/src/mavsdk/libmavsdk.so*
./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@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v4
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=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)
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@v4
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@v4
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 -DCMAKE_BUILD_TYPE=Debug -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.py . || true
- 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@v4
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: "20.04"
- 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@v4
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: configure
run: cmake -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
- name: upload core dumps
if: failure()
uses: actions/upload-artifact@v4
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@v4
with:
name: test-binaries-${{ matrix.os_type }}-${{ matrix.os_version }}-${{ github.run_id }}
path: |
./build/release/src/unit_tests/unit_tests_runner
./build/release/src/system_tests/system_tests_runner
./build/release/src/system_tests/standalone_param_test
./build/release/src/system_tests/standalone_ftp_test
./build/release/src/mavsdk/libmavsdk.so*
./build/release/src/mavsdk_server/src/libmavsdk_server.so*
retention-days: 7
- name: install
run: cmake --build build/release --target install
- name: Package
run: tools/create_packages.sh ./install . amd64 libmavsdk-dev
- name: Upload as artifact
uses: actions/upload-artifact@v4
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 }}
strategy:
fail-fast: false
matrix:
include:
- docker_name: armv6
arch_name: armv6
- docker_name: armv7
arch_name: armv7
- docker_name: arm64
arch_name: arm64
- docker_name: arm64-lts
arch_name: arm64
rename_distro: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Free Disk Space
uses: jlumbroso/[email protected]
continue-on-error: true
- name: setup dockcross
run: docker run --rm ${{ env.ARG_IMAGE }} > ./dockcross-linux-${{ matrix.docker_name }}-custom; chmod +x ./dockcross-linux-${{ matrix.docker_name }}-custom
- uses: actions/cache@v4
id: cache
with:
path: ./build/linux-${{ matrix.docker_name }}/third_party/install
key: ${{ github.job }}-linux-${{ matrix.docker_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/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
run: ./dockcross-linux-${{ matrix.docker_name }}-custom tools/create_packages.sh ./build/linux-${{ matrix.docker_name }}/install . ${{ matrix.arch_name }} libmavsdk-dev
- if: ${{ 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
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-pip rust cargo
- uses: actions/checkout@v4
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@v4
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=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
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
name: mavsdk_server_musl_x86_64
path: ./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: '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
strategy:
fail-fast: false
matrix:
arch_name: [linux-armv6-musl, linux-armv7l-musl, linux-arm64-musl]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.arch_name }}:20250818-0a27819 > ./dockcross-${{ matrix.arch_name }}; chmod +x ./dockcross-${{ matrix.arch_name }}
- uses: actions/cache@v4
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=$(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@v4
with:
name: mavsdk_server_${{ matrix.arch_name }}
path: '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: '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-24.04
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@v4
with:
submodules: recursive
fetch-depth: 0
- name: Free Disk Space
uses: jlumbroso/[email protected]
continue-on-error: true
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.name }}:20250818-0a27819 > ./dockcross-${{ matrix.name }}; chmod +x ./dockcross-${{ matrix.name }}
- uses: actions/cache@v4
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=$(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 }}/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@v4
with:
name: mavsdk_server_${{ matrix.name }}.tar
path: '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: 'build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar'
asset_name: 'mavsdk_server_${{ matrix.name }}.tar'
tag: ${{ github.ref }}
overwrite: true