forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
211 lines (206 loc) · 7.23 KB
/
test-suite.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
name: Test Suite
on:
workflow_dispatch: {}
push:
branches: [main, 'sdk-*']
paths:
- .github/workflows/test-suite.yml
- apps/bare-expo/**
- apps/test-suite/**
- packages/**
- yarn.lock
pull_request:
paths:
- .github/workflows/test-suite.yml
- apps/bare-expo/**
- apps/test-suite/**
- packages/**
- yarn.lock
# Ignore Expo CLI for now...
- '!packages/@expo/cli/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
web:
runs-on: ubuntu-20.04
steps:
- name: 👀 Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: '14.17'
- 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: 🔧 Install Expo CLI
run: yarn global add expo-cli
- name: 🧪 Run Web tests
run: yarn test:web
working-directory: apps/bare-expo
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_web }}
with:
channel: '#expo-web'
status: ${{ job.status }}
fields: job,message,ref,eventName,author,took
author_name: Test Suite (Web)
ios:
runs-on: macos-11
steps:
- name: 👀 Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: 🔨 Switch to Xcode 13.2.1
run: sudo xcode-select --switch /Applications/Xcode_13.2.1.app
- name: 🍺 Install required tools
run: |
brew tap wix/brew
brew install applesimutils
brew install watchman
- 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
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
yarn-tools: 'true'
bare-expo-pods: 'true'
- name: 🧶 Install node modules in root dir
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: 🕵️ Debug CocoaPods lockfiles
run: git diff Podfile.lock Pods/Manifest.lock
working-directory: apps/bare-expo/ios
continue-on-error: true
- name: ⚛️ Display React Native config
run: yarn react-native config
working-directory: apps/bare-expo
- name: 🌳 Display pod environment
run: pod env
working-directory: apps/bare-expo/ios
- name: 🥥 Install pods in apps/bare-expo/ios
if: steps.expo-caches.outputs.ios-pods-hit != 'true'
run: pod install
working-directory: apps/bare-expo/ios
- name: 🧹 Clean Detox
run: yarn detox:clean
working-directory: apps/bare-expo
- name: 🏗️ Build iOS project for Detox
run: yarn ios:detox:build:release
working-directory: apps/bare-expo
timeout-minutes: 30
- name: Run tests
run: yarn ios:detox:test:release
working-directory: apps/bare-expo
- name: Store images of build failures
if: always()
uses: actions/upload-artifact@v3
with:
name: bare-expo-artifacts
path: apps/bare-expo/artifacts
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
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 (iOS)
android:
runs-on: macos-11
env:
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=2048m
strategy:
matrix:
api-level: [31]
steps:
- name: 👀 Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: '14.17'
- name: 🔨 Use JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: 🍺 Install required tools
run: brew install watchman
- name: ➕ Add `bin` to GITHUB_PATH
run: echo "$(pwd)/bin" >> $GITHUB_PATH
- name: ♻️ Restore caches
uses: ./.github/actions/expo-caches
id: expo-caches
with:
yarn-workspace: 'true'
yarn-tools: 'true'
avd: 'true'
avd-api: ${{ matrix.api-level }}
- name: 🧶 Install workspace node modules
if: steps.expo-caches.outputs.yarn-workspace-hit != 'true'
run: yarn install --frozen-lockfile
- name: ⚛️ Display React Native config
run: yarn react-native config
working-directory: apps/bare-expo
- name: 🧹 Clean Detox
run: yarn detox:clean
working-directory: apps/bare-expo
- name: 🏗️ Build Android project for Detox
run: yarn android:detox:build:release
working-directory: apps/bare-expo
timeout-minutes: 35
env:
GRADLE_OPTS: '-Dorg.gradle.internal.http.connectionTimeout=180000 -Dorg.gradle.internal.http.socketTimeout=180000 -Dorg.gradle.internal.network.retry.max.attempts=18 -Dorg.gradle.internal.network.retry.initial.backOff=2000'
- name: 🧪 Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
avd-name: avd-${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
script: yarn android:detox:test:release
working-directory: ./apps/bare-expo
- name: 📸 Store images of build failures
if: always()
uses: actions/upload-artifact@v3
with:
name: bare-expo-artifacts
path: apps/bare-expo/artifacts
- name: 🔔 Notify on Slack
uses: 8398a7/action-slack@v3
if: failure() && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/heads/sdk-'))
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 (Android)