-
Notifications
You must be signed in to change notification settings - Fork 20
152 lines (132 loc) Β· 4.58 KB
/
Copy pathe2e.yml
File metadata and controls
152 lines (132 loc) Β· 4.58 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: π E2E Tests
env:
EXPO_PUBLIC_API_URL: ${{ vars.API_URL }}
EXPO_PUBLIC_AUTH_URL: ${{ vars.AUTH_URL }}
EXPO_PUBLIC_OPENAPI_URL: ${{ vars.OPENAPI_URL }}
on:
workflow_dispatch:
push:
branches: [test/e2e, test/e2e/**]
pull_request:
types: [closed]
branches: [main]
jobs:
build-apk:
name: π¨ Build APK
if: (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: π Free disk space
uses: jlumbroso/free-disk-space@main
with:
android: false
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: π Setup repo
uses: actions/checkout@v5
- name: π Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: π Setup Node
uses: actions/setup-node@v5
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: π Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: π¦ Install dependencies
run: pnpm install
- name: π Generate debug keystore
run: |
mkdir -p $HOME/.android
keytool -genkeypair -v \
-keystore $HOME/.android/debug.keystore \
-storepass android \
-alias androiddebugkey \
-keypass android \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-dname "CN=Android Debug,O=Android,C=US"
- name: π¨ Prebuild & Build APK (release)
env:
JAVA_TOOL_OPTIONS: "-XX:MaxMetaspaceSize=2048m -Dfile.encoding=UTF-8"
GRADLE_OPTS: "-Xmx4096m -XX:MaxMetaspaceSize=2048m -Dfile.encoding=UTF-8"
run: |
APP_ENV=staging npx expo prebuild --clean --platform android
cd android && ./gradlew assembleRelease --no-daemon \
-PreactNativeArchitectures=x86_64 \
-x lintVitalRelease \
--max-workers=2 \
-Pkotlin.compiler.execution.strategy=in-process \
-Pandroid.injected.signing.store.file=$HOME/.android/debug.keystore \
-Pandroid.injected.signing.store.password=android \
-Pandroid.injected.signing.key.alias=androiddebugkey \
-Pandroid.injected.signing.key.password=android
- name: π€ Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: app-release
path: android/app/build/outputs/apk/release/app-release.apk
retention-days: 1
e2e-full:
name: π Full E2E Tests
needs: build-apk
runs-on: ubuntu-latest
steps:
- name: π Enable KVM
run: sudo chmod 777 /dev/kvm
- name: π Setup repo
uses: actions/checkout@v5
- name: π Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10
- name: π Setup Node
uses: actions/setup-node@v5
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: π¦ Install dependencies
run: pnpm install
- name: π₯ Download APK artifact
uses: actions/download-artifact@v5
with:
name: app-release
path: android/app/build/outputs/apk/release/
- name: π¦ Cache Maestro
uses: actions/cache@v5
with:
path: ~/.maestro
key: maestro-${{ runner.os }}
- name: π Install Maestro
run: |
if [ ! -f "$HOME/.maestro/bin/maestro" ]; then
curl -Ls "https://get.maestro.mobile.dev" | bash
fi
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: π€ Run full E2E tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
force-avd-creation: false
disable-animations: true
pre-emulator-launch-script: |
echo "persist.sys.locale=en-US" >> $HOME/.android/avd/test.avd/config.ini
echo "persist.sys.language=en" >> $HOME/.android/avd/test.avd/config.ini
echo "persist.sys.country=US" >> $HOME/.android/avd/test.avd/config.ini
script: |
adb kill-server
adb start-server
adb wait-for-device
sleep 5
adb uninstall com.bearstudio.startuinative.staging || true
adb install android/app/build/outputs/apk/release/app-release.apk
pnpm test:e2e