-
Notifications
You must be signed in to change notification settings - Fork 10
122 lines (104 loc) · 3.64 KB
/
test-e2e-android.yaml
File metadata and controls
122 lines (104 loc) · 3.64 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
name: E2E tests - Android
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/test-e2e-android.yaml'
- 'examples/bare-example/e2e/checkLicenses/android.yaml'
- 'examples/bare-example/e2e/checkLicenses/android-get-licenses.yaml'
- 'packages/react-native-legal/**/*.[tj]sx?'
- 'packages/react-native-legal/android/**'
- 'packages/licenses-api/**/*.[tj]sx?'
- 'examples/bare-example/**/*.[tj]sx?'
- 'examples/bare-example/android/**'
push:
branches:
- main
workflow_dispatch:
concurrency:
group: e2e_tests-android-${{ github.ref }}
cancel-in-progress: true
env:
MAESTRO_CLI_NO_ANALYTICS: true
MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true
MAESTRO_DISABLE_UPDATE_CHECK: true
jobs:
e2e-android:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level: [30, 35]
steps:
- 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
- name: Checkout Repo
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Install Maestro
uses: ./.github/actions/installMaestro
with:
target-platform: android
- name: Cache Build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cached-android-build
with:
path: |
examples/bare-example/android/build
examples/bare-example/android/app/build
examples/bare-example/android/app/.cxx
key: bare-example-android-build-${{ matrix.api-level }}
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Install example dependencies
run: yarn workspace react-native-legal-bare-example install --immutable
- name: Bundle app
run: yarn workspace react-native-legal-bare-example build:android
- 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
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD, generate snapshot for caching, build app and run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: 'x86_64'
target: 'google_apis'
force-avd-creation: true
cores: 4
emulator-options: -verbose -no-snapshot-load -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none -camera-back none
disable-animations: false
ram-size: '6144M'
script: |
echo "Generated AVD snapshot for caching."
yarn workspace react-native-legal-bare-example android:release
yarn workspace react-native-legal-bare-example e2e:android
- name: Upload report
if: always()
continue-on-error: true
uses: ./.github/actions/uploadMaestroTestResults
with:
id: API ${{ matrix.api-level }}