Add integration tests #15
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: Deploy | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
TARGET: x86_64-unknown-linux-gnu | |
SUFFIX: linux-desktop | |
- os: ubuntu-22.04 | |
TARGET: armv7-unknown-linux-gnueabihf | |
SUFFIX: armv7 | |
- os: ubuntu-22.04 | |
TARGET: aarch64-unknown-linux-gnu | |
SUFFIX: aarch64 | |
- os: macos-13 | |
TARGET: x86_64-apple-darwin | |
SUFFIX: macos | |
- os: windows-2022 | |
TARGET: x86_64-pc-windows-msvc | |
SUFFIX: x86_64-pc-windows | |
EXTENSION: .exe | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set directory to safe for git | |
if: ${{ !contains(matrix.TARGET, 'windows') }} | |
# Note: Required by vergen (https://crates.io/crates/vergen) | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- name: Use cached dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: "${{ matrix.os }}-${{ matrix.TARGET }}-${{ hashFiles('**/Cargo.lock') }}" | |
shared-key: "shared" | |
- name: Install build dependencies - Rustup | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target ${{ matrix.TARGET }} -y | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Install build dependencies - Cross | |
if: ${{ contains(matrix.TARGET, 'linux') }} | |
run: cargo install cross | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Building for ${{ matrix.os }} ${{ matrix.target }} (${{ matrix.SUFFIX }}) | |
if: ${{ contains(matrix.TARGET, 'linux') }} | |
run: | | |
cd src/lib/stream/webrtc/frontend && bun install && bun run build && cd - | |
SKIP_BUN=1 cross build --release --locked --target ${{matrix.target}} --verbose | |
- name: Install gstreamer | |
if: ${{ !contains(matrix.TARGET, 'linux') }} | |
uses: blinemedical/setup-gstreamer@v1 | |
- name: Install dependencies WinPcat since it's necessary for pnet crate | |
# https://github.com/libpnet/libpnet/tree/v0.35.0?tab=readme-ov-file#windows | |
if: ${{ contains(matrix.TARGET, 'windows') }} | |
run: | | |
Invoke-WebRequest -UseBasicParsing https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip -OutFile "${Env:TEMP}\wpd.zip" | |
Expand-Archive -LiteralPath "${Env:TEMP}\wpd.zip" -DestinationPath "${Env:TEMP}\wpd" | |
Move-Item -LiteralPath "${Env:TEMP}\wpd\WpdPack\Lib" -Destination lib | |
- name: Building for ${{ matrix.os }} ${{ matrix.target }} (${{ matrix.SUFFIX }}) | |
if: ${{ !contains(matrix.TARGET, 'linux') }} | |
run: cargo build --release --locked --target ${{matrix.target}} --verbose | |
- name: Prepare files | |
run: | | |
mkdir -p upload | |
cp target/${{ matrix.TARGET }}/release/mavlink-camera-manager${{ matrix.EXTENSION }} upload/mavlink-camera-manager-${{ matrix.SUFFIX }}${{ matrix.EXTENSION }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mavlink-camera-manager-${{ matrix.SUFFIX }} | |
path: upload/* | |
- uses: svenstaro/upload-release-action@v2 | |
name: Upload binaries to release | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')}} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: 'upload/mavlink-camera-manager-*' | |
asset_name: mavlink-camera-manager-${{ matrix.SUFFIX }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |