-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1223 from mavlink/pr-musl
backend: build statically with musl
- Loading branch information
Showing
3 changed files
with
101 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,14 +124,104 @@ jobs: | |
with: | ||
submodules: recursive | ||
- name: configure | ||
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_BACKEND=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=install -DWERROR=ON -j 2 -Bbuild/release -H. | ||
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_BACKEND=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=ON -j 2 -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/backend/test/unit_tests_backend | ||
|
||
alpine-linux-qemu: | ||
runs-on: ubuntu-18.04 | ||
name: Build on alpine for ${{ matrix.arch }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- arch: armv6 | ||
distro: alpine_latest | ||
- arch: armv7 | ||
distro: alpine_latest | ||
- arch: aarch64 | ||
distro: alpine_latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Prepare ccache timestamp | ||
id: ccache_cache_timestamp | ||
shell: cmake -P {0} | ||
run: | | ||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | ||
message("::set-output name=timestamp::${current_date}") | ||
- name: ccache cache files | ||
uses: actions/[email protected] | ||
with: | ||
path: .ccache | ||
key: ${{ matrix.arch }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | ||
restore-keys: | | ||
${{ matrix.arch }}-ccache- | ||
- uses: uraimo/[email protected] | ||
name: Build | ||
id: build | ||
with: | ||
arch: ${{ matrix.arch }} | ||
distro: ${{ matrix.distro }} | ||
|
||
# Not required, but speeds up builds | ||
githubToken: ${{ github.token }} | ||
|
||
# Mount the source directory in the container | ||
dockerRunArgs: | | ||
--volume "${PWD}:/root/MAVSDK" | ||
--volume "${PWD}/.ccache:/root/.ccache" | ||
# Pass some environment variables to the container | ||
#env: | # YAML, but pipe character is necessary | ||
# artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }} | ||
|
||
# The shell to run commands with in the container | ||
shell: /bin/sh | ||
|
||
# Install some dependencies in the container. This speeds up builds if | ||
# you are also using githubToken. Any dependencies installed here will | ||
# be part of the container image that gets cached, so subsequent | ||
# builds don't have to re-install them. The image layer is cached | ||
# publicly in your project's package repository, so it is vital that | ||
# no secrets are present in the container state or logs. | ||
install: | | ||
apk update | ||
apk add build-base cmake git linux-headers libexecinfo-dev ccache | ||
run: | | ||
cd /root/MAVSDK | ||
export CC=/usr/lib/ccache/bin/gcc | ||
export CXX=/usr/lib/ccache/bin/g++ | ||
export CCACHE_COMPRESS="true" | ||
export CCACHE_MAXSIZE="400M" | ||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_BACKEND=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=ON -j 2 -Bbuild/release -H. | ||
cmake --build build/release --target install -- -j2 | ||
./build/release/src/unit_tests_runner | ||
./build/release/src/backend/test/unit_tests_backend | ||
ccache -s | ||
- name: Check the artifact | ||
run: | | ||
file "${PWD}/install/bin/mavsdk_server" | ||
- name: Publish artefacts | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: "${PWD}/install/bin/mavsdk_server" | ||
asset_name: 'mavsdk_server_musl_${{ matrix.arch }}' | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
|
||
px4-sitl-older: | ||
name: PX4 SITL ${{ matrix.px4_version }} (ubuntu-18.04) | ||
runs-on: ubuntu-18.04 | ||
|
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
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