Android CI (Connected) #1973
This file contains hidden or 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: Android CI (Connected) | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| jobs: | |
| check_date: | |
| runs-on: ubuntu-22.04 | |
| name: Check latest commit | |
| outputs: | |
| should_run: ${{ steps.should_run.outputs.should_run }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - 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-22.04 | |
| strategy: | |
| matrix: | |
| BUILD_SDK: [24, 31, 34] | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| - 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@v5 | |
| 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 |