forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (230 loc) · 8.54 KB
/
test-suite-nightly.yml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Test Suite on React Native nightly build
on:
workflow_dispatch: {}
schedule:
- cron: '0 10 * * SAT' # 10:00 AM UTC time every Saturday
push:
branches: [main]
paths:
- .github/workflows/test-suite-nightly.yml
- tools/src/commands/SetupReactNativeNightly.ts
pull_request:
paths:
- .github/workflows/test-suite-nightly.yml
- tools/src/commands/SetupReactNativeNightly.ts
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ios-build:
runs-on: macos-15
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: 🔨 Switch to Xcode 16.0
run: sudo xcode-select --switch /Applications/Xcode_16.0.app
- name: 🍺 Install required tools
run: |
brew install watchman || true
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: 💎 Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.2.2
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-tools: 'true'
- name: ⚙️ Setup react-native nightly
run: et setup-react-native-nightly
- name: ⚛️ Display React Native config
run: yarn expo-modules-autolinking react-native-config --platform ios
working-directory: apps/bare-expo
- name: 🌳 Display pod environment
run: pod env
working-directory: apps/bare-expo/ios
- name: 🥥 Update RCT-Folly and SocketRocket pods in apps/bare-expo/ios
run: pod update RCT-Folly SocketRocket --no-repo-update
working-directory: apps/bare-expo/ios
- name: 🍏 Build iOS Project
run: ./scripts/start-ios-e2e-test.ts --build
working-directory: apps/bare-expo
env:
EXPO_DEBUG: 1
NODE_ENV: production
- name: 📸 Upload builds
uses: actions/upload-artifact@v4
with:
name: bare-expo-ios-builds
path: apps/bare-expo/ios/build/BareExpo.app
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
with:
channel: '#expo-ios'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Test Suite Nightly (iOS)
ios-test:
needs: ios-build
runs-on: macos-15
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: 🌠 Download builds
uses: actions/download-artifact@v4
with:
name: bare-expo-ios-builds
path: apps/bare-expo/ios/build/BareExpo.app
- name: 🍺 Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
brew tap facebook/fb
brew install facebook/fb/idb-companion
echo "${HOME}/.maestro/bin" >> $GITHUB_PATH
# env:
# MAESTRO_VERSION: '1.33.1'
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
- name: 🧶 Install node modules in root dir
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: 🍏 Run iOS tests
run: ./scripts/start-ios-e2e-test.ts --test
working-directory: apps/bare-expo
- name: Store images of build failures
if: always()
uses: actions/upload-artifact@v4
with:
name: bare-expo-artifacts
path: |
~/.maestro/tests
~/Library/Logs/maestro
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_ios }}
with:
channel: '#expo-ios'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Test Suite Nightly (iOS)
android-build:
runs-on: ubuntu-22.04
env:
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:MaxMetaspaceSize=4096m"
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: 🧹 Cleanup GitHub Linux runner disk space
uses: ./.github/actions/cleanup-linux-disk-space
- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: 🔨 Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
gradle: 'true'
yarn-tools: 'true'
- name: ⚙️ Setup react-native nightly
run: et setup-react-native-nightly
- name: ⚛️ Display React Native config
run: yarn expo-modules-autolinking react-native-config --platform android
working-directory: apps/bare-expo
- name: 🛠️ Generate dynamic macros
run: expotools android-generate-dynamic-macros --configuration release --bare
- name: 🤖 Build Android project
run: ./gradlew -DtestBuildType=release :app:assembleRelease :app:assembleAndroidTest --no-daemon
working-directory: apps/bare-expo/android
- name: 📸 Upload builds
uses: actions/upload-artifact@v4
with:
name: bare-expo-android-builds
path: apps/bare-expo/android/app/build/outputs/apk
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_android }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
with:
channel: '#expo-android'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Test Suite Nightly (Android)
android-test:
needs: android-build
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [34]
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
- name: 🌠 Download builds
uses: actions/download-artifact@v4
with:
name: bare-expo-android-builds
path: apps/bare-expo/android/app/build/outputs/apk
- name: 🤖 Run Android tests
uses: ./.github/actions/use-android-emulator
with:
avd-api: ${{ matrix.api-level }}
avd-name: avd-${{ matrix.api-level }}
script: |
mkdir artifacts || true
adb logcat -d > artifacts/emulator.log
adb logcat -c || true
adb shell screencap -p /data/local/tmp/bareexpo.png && adb pull /data/local/tmp/bareexpo.png artifacts/beforeTests.png
./scripts/start-android-e2e-test.sh
adb shell screencap -p /data/local/tmp/bareexpo.png && adb pull /data/local/tmp/bareexpo.png artifacts/afterTests.png
adb logcat -d > artifacts/adb.log
working-directory: ./apps/bare-expo
- name: 📸 Store images of test failures
if: always()
uses: actions/upload-artifact@v4
with:
name: bare-expo-artifacts
path: apps/bare-expo/artifacts
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event_name == 'schedule' || github.event.ref == 'refs/heads/main')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_android }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
with:
channel: '#expo-android'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Test Suite Nightly (Android)