-
Notifications
You must be signed in to change notification settings - Fork 221
116 lines (104 loc) · 4.07 KB
/
android-e2e.yml
File metadata and controls
116 lines (104 loc) · 4.07 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
# =============================================================================
# Android E2E - integration tests (pre-publish)
# =============================================================================
#
# Stage: RC-E2E in the RC release pipeline.
#
# Runs the .af-e2e/test-plan.json scenarios against the plugin source
# (example linked to the plugin). Drives the unified
# scripts/af-scenario-runner.sh on an Android emulator via
# reactivecircus/android-emulator-runner (KVM on ubuntu-latest).
#
# Triggers:
# - workflow_call from rc-release.yml (the gate before publish-rc)
# - workflow_dispatch for manual reruns
# - Weekly cron (Sunday 03:00 UTC) to catch SDK / RN drift
#
# Reports land in .af-e2e/reports/ and are uploaded as android-e2e-<run>
# artifacts.
# =============================================================================
name: Android E2E
on:
workflow_call:
inputs:
ref:
description: 'Branch, tag, or SHA to check out. Defaults to the calling workflow''s ref.'
required: false
type: string
default: ''
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to check out (default: workflow ref)'
required: false
type: string
default: ''
schedule:
- cron: '0 3 * * 0'
concurrency:
group: e2e-android-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-android:
name: E2E Tests (Android)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref != '' && inputs.ref || github.ref }}
# Some ubuntu-latest runner images ship /dev/kvm owned by group kvm
# without adding the runner user to that group. The udev rule below
# grants 0666 perms so android-emulator-runner uses -accel kvm.
- name: Enable KVM group perms
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
ls -l /dev/kvm
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install example app dependencies
working-directory: example
run: npm install
- name: Write example app .env
env:
ENV_FILE: ${{ secrets.ENV_FILE }}
run: |
echo "$ENV_FILE" | base64 -d > example/.env
echo "::group::.env keys (values redacted)"
sed 's/=.*/=***/' example/.env
echo "::endgroup::"
- name: Build and run E2E on Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
arch: x86_64
profile: pixel_6
# -dns-server bypasses the host's systemd-resolved stub at 127.0.0.53,
# which the emulator's network namespace can't reach. Without this,
# every AppsFlyer SDK HTTP call fails with Unable to resolve host.
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -dns-server 8.8.8.8,1.1.1.1
disable-animations: true
script: |
set -e
adb shell 'getprop net.dns1; getprop net.dns2' || true
adb shell 'nslookup conversions.appsflyersdk.com 2>&1 | head -5' || { sleep 10; adb shell 'nslookup conversions.appsflyersdk.com 2>&1 | head -5'; } || { echo "::error::Emulator DNS cannot resolve AppsFlyer hosts"; exit 1; }
cd example/android && ./gradlew assembleDebug && cd ../..
bash ./scripts/af-scenario-runner.sh --platform android --plan .af-e2e/test-plan.json
- name: Upload E2E reports
if: always()
uses: actions/upload-artifact@v5
with:
name: android-e2e-${{ github.run_number }}
path: .af-e2e/reports/
retention-days: 30