Skip to content

Switch to GitHub actions for E2E tests #26

Switch to GitHub actions for E2E tests

Switch to GitHub actions for E2E tests #26

Workflow file for this run

name: Run end-to-end tests
on:
push:
paths:
- '*.gradle'
- '*.gradle.kts'
- '**/*.gradle'
- '**/*.gradle.kts'
- '*.properties'
- '**/*.properties'
- '**/*.kt'
- '**/*.xml'
- '.github/workflows/e2e.yml'
jobs:
instrumentation_tests:
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-33
- name: Build Release APK
run: ./gradlew :app:assembleRelease
- name: Create AVD snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-snapshot-load -camera-back none -writable-system
disable-animations: false
script: |
./app/development/scripts/provision_emulator.sh "test" "system-images;android-33;google_apis;x86_64"
echo "Generated AVD snapshot for caching."
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-snapshot-load -no-boot-anim -camera-back none -writable-system
disable-animations: true
script: |
adb root
sleep 3
adb remount
adb reboot
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
./app/development/scripts/install_app.sh
wget --quiet https://github.com/seedvault-app/seedvault-test-data/releases/download/1/backup.tar.gz
adb push backup.tar.gz /sdcard/
adb shell mkdir -p /sdcard/seedvault_baseline
adb shell tar xzf /sdcard/backup.tar.gz --directory=/sdcard/seedvault_baseline
./gradlew -Pinstrumented_test_size=large :app:connectedAndroidTest
# - name: Stop emulator
# run: adb emu kill
# - name: Run large tests
# run: ./gradlew -Pinstrumented_test_size=large :app:connectedAndroidTest
#
# - name: Run medium tests
# run: ./gradlew -Pinstrumented_test_size=medium :app:connectedAndroidTest
# - name: Pull screenshots and videos
# run: |
# adb pull /sdcard/seedvault_test_videos
# continue-on-error: true
#
# - name: Upload screenshots and videos
# uses: actions/upload-artifact@v2
# with:
# name: seedvault_test_videos
# path: seedvault_test_videos/**/*.mp4