-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add emulator tests run on Github Actions
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Instrumentation Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- api-level: 22 | ||
arch: x86 | ||
target: default | ||
- api-level: 23 | ||
arch: x86 | ||
target: default | ||
- api-level: 31 | ||
arch: x86_64 | ||
target: google_apis | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
- name: Gradle cache | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v3 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }} | ||
|
||
- 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: ${{ matrix.api-level }} | ||
arch: ${{ matrix.arch }} | ||
target: ${{ matrix.target }} | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: false | ||
ram-size: 4096M | ||
emulator-boot-timeout: 12000 | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: run tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
arch: ${{ matrix.arch }} | ||
target: ${{ matrix.target }} | ||
force-avd-creation: false | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
ram-size: 4096M | ||
emulator-boot-timeout: 12000 | ||
script: ./gradlew :instrumentation:connectedCheck :integration:compose:connectedCheck |
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
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
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
@sjudd Did you mean allowedVersions?