Switch to GitHub actions for E2E tests #34
Workflow file for this run
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: 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: -writable-system -no-snapshot-load -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
./app/development/scripts/provision_emulator.sh "test" "system-images;android-33;google_apis;x86_64" | |
echo "Generated AVD snapshot for caching." | |
- name: Assemble tests | |
run: ./gradlew :app:assembleAndroidTest | |
- 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: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
./app/development/scripts/install_app.sh | |
sleep 10 | |
adb shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport | |
set +e # Disable error exit | |
./gradlew -Pinstrumented_test_size=large :app:connectedAndroidTest | |
gradle_exit_code=$? | |
set -e # Enable error exit | |
adb pull /sdcard/seedvault_test_videos | |
if [ $gradle_exit_code -ne 0 ]; then | |
echo "Gradle test failed." | |
exit 1 | |
fi | |
- name: Upload screenshots and videos | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: seedvault_test_videos | |
path: seedvault_test_videos/**/*.mp4 |