Ci xcframework sitescan test #3402
Workflow file for this run
This file contains 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: Build and Test | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
coverage: | |
name: coverage (ubuntu-20.04) | |
runs-on: ubuntu-20.04 | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
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 | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: configure | |
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Coverage -DASAN=ON -DWERROR=OFF -Bbuild -H. | |
- name: build | |
run: cmake --build build -j2 | |
- name: test | |
run: ./build/src/unit_tests_runner | |
- name: run lcov | |
run: lcov --capture --directory . --no-external --exclude "*/third_party/*" --output-file lcov.info | |
- name: check size of lcov.info | |
run: | | |
ls -l lcov.info | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "./lcov.info" | |
ubuntu20-non-superbuild: | |
name: ubuntu-20.04 (non-mavsdk_server, non-superbuild) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install | |
run: sudo apt-get update && sudo apt-get install -y libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: configure | |
run: cmake -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=OFF -DWERROR=OFF -Bbuild/release -H. | |
- name: build | |
run: cmake --build build/release -j2 | |
- name: test | |
run: ./build/release/src/unit_tests_runner | |
ubuntu20-superbuild: | |
name: ubuntu-20.04 (mavsdk_server, superbuild) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
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: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3-future | |
- name: configure | |
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/release -H. | |
- name: build | |
run: cmake --build build/release -j2 | |
- name: install | |
run: sudo cmake --build build/release --target install | |
- name: install examples dependencies | |
run: sudo apt-get install -y libsdl2-dev | |
- name: configure examples | |
run: (cd examples && cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -Bbuild -H.) | |
- name: build examples | |
run: (cd examples && cmake --build build -j2) | |
- name: test | |
run: ./build/release/src/unit_tests_runner | |
- name: test (mavsdk_server) | |
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server | |
- name: test FTP server | |
run: ./build/release/src/integration_tests/integration_tests_runner --gtest_filter="FtpTest.TestServer" | |
ubuntu20-hunter: | |
name: ubuntu-20.04 (mavsdk, hunter) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ~/.hunter | |
key: ${{ github.job }}-${{ hashFiles('~/.hunter/**') }} | |
- name: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3-future | |
- name: prepare mavlink headers because this is without superbuild | |
run: tools/generate_mavlink_headers.sh | |
- name: configure | |
run: cmake -DSUPERBUILD=OFF -DHUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=$(pwd)/src/cmake/fpic_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=OFF -DMAVLINK_HEADERS=mavlink-headers/include -Bbuild -H. | |
- name: build | |
run: cmake --build build -j2 | |
- name: run unit test | |
run: build/src/unit_tests_runner | |
ubuntu20-proto-check: | |
name: ubuntu-20.04 (proto check) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install clang-format | |
run: sudo apt-get update && sudo apt-get install -y clang-format-10 | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: install protoc-gen-mavsdk | |
run: | | |
cd proto/pb_plugins | |
pip3 install --user -r requirements.txt | |
pip3 install --user -e . | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/default/third_party/install | |
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }} | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/default/third_party/install" >> $GITHUB_ENV | |
- name: build necessary protoc tooling | |
run: cmake $superbuild $cmake_prefix_path -DBUILD_MAVSDK_SERVER=ON -Bbuild/default -H. | |
- name: generate code from protos | |
run: PATH="$PATH:$HOME/.local/bin" tools/generate_from_protos.sh | |
- name: fix style | |
run: tools/fix_style.sh . || true | |
- name: check for diff | |
run: git diff --exit-code | |
ubuntu20-check-style: | |
name: ubuntu-20.04 (check style and docs) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install dependencies | |
run: sudo apt-get update && sudo apt-get install -y doxygen clang-format-10 | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: check style | |
run: ./tools/fix_style.sh . | |
- name: check docs | |
run: tools/generate_docs.sh | |
deb-package: | |
name: ${{ matrix.container_name }} (package, non-mavsdk_server) | |
runs-on: ubuntu-20.04 | |
container: mavsdk/mavsdk-${{ matrix.container_name }} | |
strategy: | |
matrix: | |
container_name: [ubuntu-18.04, ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: git permission workaround | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git config --global --add safe.directory /github/workspace | |
- name: Install latest cmake | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - | |
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' | |
sudo apt-get update | |
sudo apt-get install -y cmake | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: configure | |
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H. | |
- name: build | |
run: cmake --build build/release --target install -- -j2 | |
- name: Package | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: tools/create_packages.sh ./install . amd64 libmavsdk-dev | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: '*.deb' | |
tag: ${{ github.ref }} | |
overwrite: true | |
debian-packaging: | |
name: Ubuntu/Debian packaging (Ubuntu 20.04) | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: install packages | |
run: sudo apt-get update && sudo apt-get install -y build-essential debhelper fakeroot libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev libjsoncpp1 libcurl4 libtinyxml2-6a | |
- name: install pymavlink dependencies | |
run: sudo apt-get install -y python3-future | |
- name: prepare mavlink headers because this is without superbuild | |
run: tools/generate_mavlink_headers.sh | |
- name: generate changelog | |
run: ./tools/generate_debian_changelog.sh > debian/changelog | |
- name: Build package | |
run: dpkg-buildpackage -us -uc -b | |
rpm-package: | |
name: ${{ matrix.container_name }} (package, non-mavsdk_server) | |
runs-on: ubuntu-20.04 | |
container: mavsdk/mavsdk-${{ matrix.container_name }} | |
strategy: | |
matrix: | |
container_name: [fedora-34, fedora-35] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: git permission workaround | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git config --global --add safe.directory /github/workspace | |
- name: configure | |
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H. | |
- name: build | |
run: cmake --build build/release --target install -- -j2 | |
- name: Package | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: tools/create_packages.sh ./install . x86_64 mavsdk-devel | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: '*.rpm' | |
tag: ${{ github.ref }} | |
overwrite: true | |
dockcross-linux-arm: | |
name: linux-${{ matrix.arch_name }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
arch_name: [armv6, armv7, arm64] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3 python3-future | |
- name: prepare mavlink headers | |
run: tools/generate_mavlink_headers.sh | |
- name: setup dockcross | |
run: docker run --rm mavsdk/mavsdk-dockcross-linux-${{ matrix.arch_name }}-custom > ./dockcross-linux-${{ matrix.arch_name }}-custom; chmod +x ./dockcross-linux-${{ matrix.arch_name }}-custom | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/linux-${{ matrix.arch_name }}/third_party/install | |
key: ${{ github.job }}-linux-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }}-4 | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/linux-${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV | |
- name: configure | |
run: ./dockcross-linux-${{ matrix.arch_name }}-custom /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/linux-${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DWERROR=OFF -DMAVLINK_HEADERS=mavlink-headers/include -Bbuild/linux-${{ matrix.arch_name }} -H." | |
- name: build | |
run: ./dockcross-linux-${{ matrix.arch_name }}-custom cmake --build build/linux-${{ matrix.arch_name }} -j2 --target install | |
- name: create deb packages | |
run: ./dockcross-linux-${{ matrix.arch_name }}-custom tools/create_packages.sh ./build/linux-${{ matrix.arch_name }}/install . ${{ matrix.arch_name }} libmavsdk-dev | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: '*.deb' | |
tag: ${{ github.ref }} | |
overwrite: true | |
dockcross-manylinux2010-x64: | |
name: manylinux2010-x64 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/manylinux2010-x64/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=/work/build/manylinux2010-x64/third_party/install" >> $GITHUB_ENV | |
- name: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3 python3-future | |
- name: prepare mavlink headers | |
run: tools/generate_mavlink_headers.sh | |
- name: setup dockcross | |
run: docker run --rm dockcross/manylinux2010-x64 > ./dockcross-manylinux2010-x64; chmod +x ./dockcross-manylinux2010-x64 | |
- name: configure | |
run: ./dockcross-manylinux2010-x64 cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/manylinux2010-x64/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -DMAVLINK_HEADERS=mavlink-headers/include -Bbuild/manylinux2010-x64 -H. | |
- name: build | |
run: ./dockcross-manylinux2010-x64 cmake --build build/manylinux2010-x64 -j2 --target install | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/manylinux2010-x64/install/bin/mavsdk_server' | |
asset_name: 'mavsdk_server_manylinux2010-x64' | |
tag: ${{ github.ref }} | |
overwrite: true | |
alpine-linux: | |
name: alpine 3.11.6 (musl) | |
runs-on: ubuntu-20.04 | |
container: alpine:3.11.6 | |
steps: | |
- name: install tools | |
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-future | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/release/third_party/install | |
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }} | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV | |
- name: configure | |
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H. | |
- name: build | |
run: cmake --build build/release --target install -- -j2 | |
- name: test | |
run: ./build/release/src/unit_tests_runner | |
- name: test (mavsdk_server) | |
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server | |
- name: Upload as artefact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mavsdk_server_musl_x86_64 | |
path: ./install/bin/mavsdk_server | |
retention-days: 2 | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'install/bin/mavsdk_server' | |
asset_name: 'mavsdk_server_musl_x86_64' | |
tag: ${{ github.ref }} | |
overwrite: true | |
dockcross-linux-musl: | |
name: ${{ matrix.arch_name }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
arch_name: [linux-armv6-musl, linux-armv7l-musl, linux-arm64-musl] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3 python3-future | |
- name: prepare mavlink headers | |
run: tools/generate_mavlink_headers.sh | |
- name: setup dockcross | |
run: docker run --rm dockcross/${{ matrix.arch_name }} > ./dockcross-${{ matrix.arch_name }}; chmod +x ./dockcross-${{ matrix.arch_name }} | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/${{ matrix.arch_name }}/third_party/install | |
key: ${{ github.job }}-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }} | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV | |
- name: configure | |
run: ./dockcross-${{ matrix.arch_name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DWERROR=OFF -DMAVLINK_HEADERS=mavlink-headers/include -Bbuild/${{ matrix.arch_name }} -H." | |
- name: build | |
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/${{ matrix.arch_name }} -j2 --target install | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/${{ matrix.arch_name }}/install/bin/mavsdk_server' | |
asset_name: 'mavsdk_server_${{ matrix.arch_name }}' | |
tag: ${{ github.ref }} | |
overwrite: true | |
dockcross-android: | |
name: ${{ matrix.name }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
include: | |
- name: android-arm | |
arch: armeabi-v7a | |
- name: android-arm64 | |
arch: arm64-v8a | |
- name: android-x86 | |
arch: x86 | |
- name: android-x86_64 | |
arch: x86_64 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install pymavlink dependencies | |
run: sudo apt-get update && sudo apt-get install -y python3 python3-future | |
- name: prepare mavlink headers | |
run: tools/generate_mavlink_headers.sh | |
- name: setup dockcross | |
run: docker run --rm dockcross/${{ matrix.name }} > ./dockcross-${{ matrix.name }}; chmod +x ./dockcross-${{ matrix.name }} | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/${{ matrix.name }}/third_party/install | |
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }} | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV | |
- name: configure | |
run: ./dockcross-${{ matrix.name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -DMAVLINK_HEADERS=mavlink-headers/include -Bbuild/${{ matrix.name }} -H." | |
- name: build | |
run: ./dockcross-${{ matrix.name }} cmake --build build/${{ matrix.name }} -j2 --target install | |
- name: create tar with header and library | |
run: mkdir -p build/${{ matrix.name }}/export/include; cp build/${{ matrix.name }}/install/include/mavsdk/mavsdk_server/mavsdk_server_api.h build/${{ matrix.name }}/export/include; mkdir -p build/${{ matrix.name }}/export/${{ matrix.arch }}; cp build/${{ matrix.name }}/install/lib/libmavsdk_server.so build/${{ matrix.name }}/export/${{ matrix.arch }}; tar -C build/${{ matrix.name }}/export -cf build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar ${{ matrix.arch }} include; | |
- name: Publish artefacts | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar' | |
asset_name: 'mavsdk_server_${{ matrix.name }}.tar' | |
tag: ${{ github.ref }} | |
overwrite: true | |
macOS: | |
name: ${{ matrix.name }} | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
include: | |
- name: macOS | |
build-framework: OFF | |
- name: macOS-framework | |
build-framework: ON | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/macos/third_party/install | |
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }} | |
- name: fetch git tags for version | |
run: git fetch --tags | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/macos/third_party/install" >> $GITHUB_ENV | |
- name: set SDKROOT value | |
run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV | |
- name: install pymavlink dependencies | |
run: python3 -m pip install future | |
- name: configure | |
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/macos/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DMACOS_FRAMEWORK=${{ matrix.build-framework }} -DWERROR=OFF -Bbuild/macos -H. | |
- name: build | |
run: cmake --build build/macos -j2 --target install | |
- name: test (core) | |
run: ./build/macos/src/unit_tests_runner | |
- name: test (mavsdk_server) | |
run: ./build/macos/src/mavsdk_server/test/unit_tests_mavsdk_server | |
- name: Upload framework as artefact | |
if: ${{ matrix.build-framework == 'ON' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: mavsdk_server_macos.framework | |
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework | |
retention-days: 2 | |
- name: Publish mavsdk_server_macos to github release | |
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.build-framework == 'OFF' }} | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/macos/install/bin/mavsdk_server' | |
asset_name: 'mavsdk_server_macos' | |
tag: ${{ github.ref }} | |
overwrite: true | |
iOS: | |
name: ${{ matrix.name }} | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
include: | |
- name: ios | |
platform: OS64 | |
sdk: iphoneos | |
- name: ios_simulator | |
platform: SIMULATOR64 | |
sdk: iphonesimulator | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
id: cache | |
with: | |
path: ./build/${{ matrix.name }}/third_party/install | |
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**', './tools/ios.toolchain.cmake') }} | |
- name: fetch git tags for version | |
run: git fetch --tags | |
- name: disable superbuild on cache hit | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV | |
- name: set SDK-related environment variables (for non-cmake deps) | |
run: | | |
echo "SDKROOT=$(xcrun --sdk ${{ matrix.sdk }} --show-sdk-path)" >> $GITHUB_ENV | |
- name: install pymavlink dependencies | |
run: python3 -m pip install future | |
- name: configure | |
run: cmake $superbuild $cmake_prefix_path -DENABLE_STRICT_TRY_COMPILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(pwd)/tools/ios.toolchain.cmake -DPLATFORM=${{ matrix.platform }} -DDEPLOYMENT_TARGET=13.0 -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H. | |
- name: build | |
run: cmake --build build/${{ matrix.name }} -j2 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: mavsdk_server_${{ matrix.name }}.framework | |
path: ./build/${{ matrix.name }}/src/mavsdk_server/src/mavsdk_server.framework | |
retention-days: 2 | |
iOS-XCFramework: | |
name: iOS XCFramework | |
needs: [macOS, iOS] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/download-artifact@v2 | |
with: | |
name: mavsdk_server_ios.framework | |
path: ./build/ios/src/mavsdk_server/src/mavsdk_server.framework | |
- uses: actions/download-artifact@v2 | |
with: | |
name: mavsdk_server_ios_simulator.framework | |
path: ./build/ios_simulator/src/mavsdk_server/src/mavsdk_server.framework | |
- uses: actions/download-artifact@v2 | |
with: | |
name: mavsdk_server_macos.framework | |
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework | |
- name: Package | |
run: bash ./src/mavsdk_server/tools/package_mavsdk_server_framework.bash | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: mavsdk_server.xcframework | |
path: ./build/mavsdk_server.xcframework | |
retention-days: 2 | |
- name: Publish xcframework | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/mavsdk_server.xcframework.zip' | |
asset_name: 'mavsdk_server.xcframework.zip' | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: Publish xcframework checksum | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/mavsdk_server.xcframework.zip.sha256' | |
asset_name: 'mavsdk_server.xcframework.zip.sha256' | |
tag: ${{ github.ref }} | |
overwrite: true | |
Windows: | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v2 | |
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" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: install packages | |
run: | | |
choco install nasm | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: install pymavlink dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install wheel | |
python3 -m pip install future | |
- name: configure | |
run: cmake -G "Visual Studio 17 2022" $env:superbuild $env:cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/release/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/release -S. | |
- name: build | |
run: cmake --build build/release -j2 --config Release --target install | |
- name: Create zip file mavsdk libraries | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: cd build/release/install && 7z.exe a -tzip ../../../mavsdk-windows-x64-release.zip . && cd ../../.. | |
- name: Publish mavsdk libraries | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'mavsdk-windows-x64-release.zip' | |
asset_name: 'mavsdk-windows-x64-release.zip' | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: Publish mavsdk_server binary | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'build/release/install/bin/mavsdk_server_bin.exe' | |
asset_name: 'mavsdk_server_win32.exe' | |
tag: ${{ github.ref }} | |
overwrite: true | |
px4-sitl-newer: | |
name: PX4 SITL ${{ matrix.px4_version }} (ubuntu-20.04) | |
runs-on: ubuntu-20.04 | |
container: mavsdk/mavsdk-ubuntu-20.04-px4-sitl-${{ matrix.px4_version }} | |
strategy: | |
matrix: | |
px4_version: [v1.11, v1.12] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: git permission workaround | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git config --global --add safe.directory /github/workspace | |
- name: install pymavlink dependencies | |
run: python3 -m pip install future | |
- name: test | |
run: PX4_VERSION=${{ matrix.px4_version }} tools/run-sitl-tests.sh /home/user/Firmware | |
timeout-minutes: 45 | |
- name: look at core files | |
if: failure() | |
run: gdb /home/user/Firmware/build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit" | |
apm-sitl-newer: | |
name: APM SITL ${{ matrix.apm_version }} (ubuntu-20.04) | |
runs-on: ubuntu-20.04 | |
container: | |
image: mavsdk/mavsdk-ubuntu-20.04-apm-sitl-${{ matrix.apm_version }} | |
options: --privileged | |
env: | |
APM_HOME_LAT: 47.397742 | |
APM_HOME_LONG: 8.545594 | |
APM_HOME_ALT: 488.0 | |
APM_HOME_DIR: 180 | |
WORKDIR: "/home/user/MAVSDK" | |
FIRMWARE_DIR: /home/user/ArduPilot | |
strategy: | |
matrix: | |
apm_version: [copter-4.1.2] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: git permission workaround | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
git config --global --add safe.directory /github/workspace | |
- name: install pymavlink dependencies | |
run: python3 -m pip install future | |
- name: test | |
run: APM_VERSION=${{ matrix.apm_version }} tools/run-sitl-tests.sh /home/user/ArduPilot | |
timeout-minutes: 45 |