-
Notifications
You must be signed in to change notification settings - Fork 10
127 lines (109 loc) · 3.58 KB
/
expo-example-e2e.yml
File metadata and controls
127 lines (109 loc) · 3.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
name: Expo Example E2E Tests
on:
push:
branches: [main]
paths:
- 'packages/react-native-legal/**'
- 'examples/expo-example/**'
- '.github/workflows/expo-example-e2e.yml'
pull_request:
paths:
- 'packages/react-native-legal/**'
- 'examples/expo-example/**'
- '.github/workflows/expo-example-e2e.yml'
jobs:
android-e2e:
name: Android E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: examples/expo-example
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- 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: Prebuild
run: yarn expo prebuild --platform android
- name: Build Android
run: |
cd android && ./gradlew assembleRelease || {
echo "Error: Failed to build Android app"
exit 1
}
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
source $HOME/.bash_profile
maestro --version
- name: Run Android E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
profile: pixel_7
api-level: 34
target: google_apis
arch: x86_64
disable-animations: true
script: |
adb install -r android/app/build/outputs/apk/release/app-release.apk || {
echo "Error: Failed to install Android APK"
exit 1
}
yarn test:e2e:android
ios-e2e:
name: iOS E2E Tests
runs-on: macos-latest
timeout-minutes: 45
defaults:
run:
working-directory: examples/expo-example
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Prebuild
run: yarn expo prebuild --platform ios
- name: Setup iOS Simulator
uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 15'
- name: Build iOS
run: |
xcodebuild -workspace ios/ReactNativeLegalExpoExample.xcworkspace \
-scheme ReactNativeLegalExpoExample \
-sdk iphonesimulator \
-configuration Release \
-derivedDataPath build || {
echo "Error: Failed to build iOS app"
exit 1
}
- name: Install iOS app
run: |
xcrun simctl install booted ./build/Build/Products/Release-iphonesimulator/ReactNativeLegalExpoExample.app || {
echo "Error: Failed to install iOS app"
exit 1
}
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
source $HOME/.bash_profile
maestro --version
- name: Run iOS E2E tests
run: yarn test:e2e:ios