mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
136 lines
4.4 KiB
YAML
136 lines
4.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
rust:
|
|
name: Rust (Clippy & Unit Tests)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install native Linux dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
build-essential pkg-config \
|
|
libglib2.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
|
|
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
|
|
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav \
|
|
libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \
|
|
libvulkan-dev libopenxr-dev libgl1-mesa-dev libfontconfig1-dev
|
|
|
|
- name: Setup Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Cache Cargo registry & build artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Run cargo clippy (strict)
|
|
run: cargo clippy --workspace --no-deps --all-targets -- -D warnings
|
|
|
|
- name: Run cargo test
|
|
run: cargo test --workspace
|
|
|
|
scripts-and-python:
|
|
name: Shell & Python Validation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Validate shell scripts syntax (bash -n)
|
|
run: bash -n launch.sh launch_vr.sh scripts/*.sh
|
|
|
|
- name: Validate Python relay syntax & unit tests
|
|
run: |
|
|
python3 -m py_compile scripts/radxa_g29_relay.py scripts/test_radxa_g29_relay.py
|
|
python3 -m unittest discover -s scripts -p "test_*.py" -v
|
|
|
|
firmware-rp2350:
|
|
name: Firmware RP2350 (g29_crsf.ino)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install arduino-cli, rp2040 core and firmware libraries
|
|
run: |
|
|
mkdir -p "$HOME/.local/bin"
|
|
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$HOME/.local/bin" sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
"$HOME/.local/bin/arduino-cli" config init
|
|
"$HOME/.local/bin/arduino-cli" config set board_manager.additional_urls \
|
|
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
|
|
"$HOME/.local/bin/arduino-cli" core update-index
|
|
"$HOME/.local/bin/arduino-cli" core install rp2040:rp2040
|
|
"$HOME/.local/bin/arduino-cli" lib install "Pico PIO USB" "Adafruit NeoPixel"
|
|
|
|
- name: Compile g29_crsf firmware for Waveshare RP2350 Plus
|
|
run: |
|
|
arduino-cli compile \
|
|
--fqbn rp2040:rp2040:waveshare_rp2350_plus:usbstack=tinyusb \
|
|
firmware/g29_crsf
|
|
|
|
android-apk:
|
|
name: Android APK (arm64-v8a / Tab S8 Ultra)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
|
|
- name: Setup Rust toolchain (aarch64-linux-android)
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-linux-android
|
|
|
|
- name: Cache Cargo registry & build artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install cargo-ndk
|
|
run: cargo install cargo-ndk --locked
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Ensure Android SDK 36 & Build Tools
|
|
run: |
|
|
yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" \
|
|
"platforms;android-36" "build-tools;36.0.0" >/dev/null
|
|
|
|
- name: Build Rust native library (arm64-v8a)
|
|
run: |
|
|
mkdir -p android/app/src/main/jniLibs
|
|
cargo ndk -t arm64-v8a --platform 31 -o android/app/src/main/jniLibs build -p fpv-android-ffi --release
|
|
|
|
- name: Build Android APK (debug, ready to install)
|
|
working-directory: android
|
|
run: ./gradlew assembleDebug
|
|
|
|
- name: Upload Android APK artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: steamframe-fpv-android-arm64-apk
|
|
path: android/app/build/outputs/apk/debug/app-debug.apk
|
|
retention-days: 14
|