Skip to content

Commit 59439ff

Browse files
committed
Add E2E test to CI
1 parent d3417dc commit 59439ff

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
unit-tests:
2525
uses: ./.github/workflows/unit-tests.yml
2626

27+
e2e-tests:
28+
uses: ./.github/workflows/e2e-tests.yml
29+
secrets:
30+
PLAYSTORE_SECRET_PASSPHRASE: ${{ secrets.PLAYSTORE_SECRET_PASSPHRASE }}
31+
2732
coverage:
2833
uses: ./.github/workflows/coverage.yml
2934

.github/workflows/e2e-tests.yml

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

0 commit comments

Comments
 (0)