|
| 1 | +on: |
| 2 | + workflow_call: |
| 3 | + |
| 4 | +jobs: |
| 5 | + e2e-tests: |
| 6 | + name: 📲 E2E tests |
| 7 | + runs-on: ubuntu-24.04 |
| 8 | + |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - uses: ./.github/actions/setup-jdk-gradle |
| 12 | + |
| 13 | + - name: 🔓 Decrypt secrets |
| 14 | + env: |
| 15 | + PLAYSTORE_SECRET_PASSPHRASE: ${{ secrets.PLAYSTORE_SECRET_PASSPHRASE }} |
| 16 | + run: ./_ci/decrypt_secrets.sh |
| 17 | + |
| 18 | + - name: 🔓 Enable KVM group permissions |
| 19 | + run: | |
| 20 | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 21 | + sudo udevadm control --reload-rules |
| 22 | + sudo udevadm trigger --name-match=kvm |
| 23 | +
|
| 24 | + - name: 📦 AVD cache |
| 25 | + uses: actions/cache@v4 |
| 26 | + id: avd-cache |
| 27 | + with: |
| 28 | + path: | |
| 29 | + ~/.android/avd/* |
| 30 | + ~/.android/adb* |
| 31 | + key: avd-30 |
| 32 | + |
| 33 | + - name: Create AVD with cacheable snapshot |
| 34 | + if: steps.avd-cache.outputs.cache-hit != 'true' |
| 35 | + uses: reactivecircus/android-emulator-runner@v2 |
| 36 | + with: |
| 37 | + api-level: 30 |
| 38 | + arch: x86_64 |
| 39 | + target: google_apis |
| 40 | + force-avd-creation: false |
| 41 | + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 42 | + disable-animations: false |
| 43 | + script: echo "Generated AVD snapshot for caching." |
| 44 | + |
| 45 | + - name: 📲 Happy path E2E test |
| 46 | + uses: reactivecircus/android-emulator-runner@v2 |
| 47 | + with: |
| 48 | + api-level: 30 |
| 49 | + arch: x86_64 |
| 50 | + target: google_apis |
| 51 | + force-avd-creation: false |
| 52 | + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
| 53 | + disable-animations: true |
| 54 | + script: ./gradlew --no-daemon --parallel :tasks-app-android:connectedStoreDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=net.opatry.tasks.app.test.e2e.TaskfolioE2ETest |
| 55 | + |
| 56 | + - name: 🗒️ Publish Test Reports |
| 57 | + uses: mikepenz/action-junit-report@v4 |
| 58 | + if: success() || failure() |
| 59 | + with: |
| 60 | + detailed_summary: true |
| 61 | + require_passed_tests: true |
| 62 | + require_tests: true |
| 63 | + report_paths: '**/build/outputs/androidTest-results/connected/**/*.xml' |
0 commit comments