Skip to content

Android CI (Connected) #1274

Android CI (Connected)

Android CI (Connected) #1274

Workflow file for this run

name: Android CI (Connected)
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v4
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: Check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_ENV
connectedCheck:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
strategy:
matrix:
BUILD_SDK: [24, 31, 34]
steps:
- name: checkout
uses: actions/checkout@v4
- 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: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Configure build
run: |
echo "emulator_arch=x86_64" >> $GITHUB_ENV
- name: run tests
uses: vitalyster/android-emulator-runner@xvfb
with:
api-level: ${{ matrix.BUILD_SDK }}
arch: ${{ env.emulator_arch }}
target: google_apis
force-avd-creation: false
disable-animations: true
emulator-options: -no-snapshot-save -noaudio -no-boot-anim -camera-back none -skin 540x1110
script: ./gradlew --no-daemon connectedFreeDebugAndroidTest