-
Notifications
You must be signed in to change notification settings - Fork 25
125 lines (110 loc) · 4.12 KB
/
android-e2e.yml
File metadata and controls
125 lines (110 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Android E2E
on:
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
default: ''
workflow_dispatch:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
default: ''
schedule:
- cron: '15 4 * * 0'
concurrency:
group: android-e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
android-e2e:
name: Android E2E (qa-test-app, plugin source)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Enable KVM (required by android-emulator-runner)
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: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install plugin dependencies
run: npm install
- name: Build plugin
run: npm run build
- name: Write QA test app .env from secret
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
working-directory: examples/qa-test-app
run: |
if [ -z "$ENV_FILE" ]; then
echo "ENV_FILE secret is not set; aborting"
exit 1
fi
printf '%s\n' "$ENV_FILE" > .env
echo "Wrote $(wc -l < .env) lines to .env (values redacted)"
- name: Install QA test app dependencies
working-directory: examples/qa-test-app
run: npm install
- name: Build web bundle
working-directory: examples/qa-test-app
run: npm run build
- name: Capacitor sync (android)
working-directory: examples/qa-test-app
run: npx cap sync android
- name: Pin AppsFlyer-host DNS resolution (precheck)
run: |
# Make sure the GitHub runner can reach AppsFlyer endpoints before
# we boot the emulator. The emulator inherits DNS via -dns-server.
for host in oyoxfj.conversions.appsflyersdk.com t.appsflyer.com conversions.appsflyer.com; do
echo "--- nslookup $host ---"
nslookup "$host" 8.8.8.8 || true
done
- name: Run E2E scenarios on Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
arch: x86_64
target: google_apis
profile: pixel_6
# GitHub-hosted ubuntu-latest public-repo runners have 4 vCPU / 16GB
# RAM. Default emulator allocation is 2 cores / 2GB, which leaves the
# warm-app activity-lifecycle path racing against the SDK's
# ActivityLifecycleCallbacks observer on a slow x86_64 / no-window
# emulator. Bumping cores + memory gives the Android lifecycle
# transitions enough headroom to fire onResume before our trigger
# (and matches the resource profile of real devices).
cores: 4
ram-size: 4096M
emulator-options: -dns-server 8.8.8.8,1.1.1.1 -no-window -no-snapshot -no-boot-anim -gpu swiftshader_indirect -accel on
disable-animations: true
# reactivecircus/android-emulator-runner@v2 executes each line of
# `script:` through a separate `sh -c`, so backslash continuations
# break (the literal "\" is passed as an arg to the next line).
# Keep the runner invocation on a single line.
script: |
chmod +x ./scripts/af-scenario-runner.sh
./scripts/af-scenario-runner.sh --platform android --plan .af-e2e/test-plan.json --build --verbose
- name: Upload E2E reports
if: always()
uses: actions/upload-artifact@v4
with:
name: android-e2e-reports
path: |
.af-e2e/reports/
if-no-files-found: warn
retention-days: 14