Merge pull request #23 from amberin/pipeline #61
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: | |
pull_request: | |
branches: | |
- 'master' | |
push: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
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: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 7.5 | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-29 | |
save-always: true | |
- 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 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
disable-spellchecker: true | |
profile: Nexus 6 | |
script: echo "Generated AVD snapshot for caching." | |
- name: Save AVD to cache | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-29 | |
- name: Add Dropbox API credentials | |
shell: bash | |
run: | | |
echo "dropbox.token = \"${{ secrets.DROPBOX_APP_TOKEN }}\"" >> app.properties | |
echo "dropbox.app_key = \"${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties | |
echo "dropbox.app_key_schema = \"db-${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties | |
- name: run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
disable-spellchecker: true | |
profile: Nexus 6 | |
script: ./gradlew connectedCheck |