Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 67 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
# Latest stable and MSRV. We only run checks with all features enabled
# for the MSRV build to keep CI fast, since other configurations should also work.
rust_version: [stable, "1.71.0"]
rust_version: [stable, "1.77.0"]
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust_version }}
components: clippy
- uses: actions/checkout@v4

- name: Add Android target
if: ${{ matrix.os == 'ubuntu-latest' }}
run: rustup target add x86_64-linux-android

- name: Run `cargo clippy` with no features
if: ${{ matrix.rust_version == 'stable' }}
run: cargo clippy --verbose --no-default-features -- -D warnings -D clippy::dbg_macro
Expand All @@ -48,6 +52,14 @@ jobs:

- name: Run `cargo clippy` with all features
run: cargo clippy --verbose --all-features -- -D warnings -D clippy::dbg_macro

- name: Run `cargo clippy` with no features on Android
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo clippy --target x86_64-linux-android --verbose --no-default-features -- -D warnings -D clippy::dbg_macro

- name: Run `cargo clippy` with `image-data` feature on Android
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo clippy --target x86_64-linux-android --verbose --no-default-features --features image-data -- -D warnings -D clippy::dbg_macro

- name: Run `cargo clippy` with dependency version checks
if: ${{ matrix.rust_version == 'stable' }}
Expand Down Expand Up @@ -89,7 +101,7 @@ jobs:
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-10-08
toolchain: nightly-2024-01-08
components: miri

- name: Checkout
Expand All @@ -104,3 +116,56 @@ jobs:
- uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2

android_emulator:
needs: clippy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: Install `cargo-apk`
run: cargo install cargo-apk

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
target: default
profile: Nexus 6
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run android example
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
arch: x86_64
target: default
profile: Nexus 6
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./tools/android_test.sh
Loading
Loading