build(gui): update gtk-rs #739
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: "test" | |
on: | |
- push | |
jobs: | |
rust_test_linux: | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:23.10 | |
steps: | |
- name: Install basic requirements | |
run: | | |
apt-get update | |
apt-get install -y git curl unzip | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies from apt | |
run: | | |
apt-get install -y libdbus-1-dev pkg-config libgtk-4-dev libadwaita-1-dev protobuf-compiler | |
- name: Install display server | |
run: | | |
apt-get install -y xvfb | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Cache cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Run rust tests | |
run: xvfb-run --auto-servernum cargo make test-cov | |
- name: Generate HTML test coverage report | |
run: cargo make test-cov-report-html | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
path: target/llvm-cov/html/ | |
# Only lib is tested on windows since building gtk takes too long, and lib is the only crate with os specific code | |
rust_test_windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Run rust tests | |
run: cargo make integration-test | |
android_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set ANDROID_NDK_HOME to latest NDK version | |
run: | | |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> "$GITHUB_ENV" | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install protoc | |
run: sudo apt install -y protobuf-compiler | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin # See 'Supported distributions' for available options | |
java-version: 17 | |
- uses: gradle/actions/setup-gradle@v3 | |
- name: Cache cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-ndk | |
run: cargo install cargo-ndk | |
- name: Run android unit tests | |
working-directory: android | |
run: ./gradlew testBluetoothDebugUnitTest | |
# - name: Run android instrumented tests | |
# working-directory: android | |
# run: ./gradlew connectedAndroidTest |