-
-
Notifications
You must be signed in to change notification settings - Fork 38
208 lines (170 loc) · 5.42 KB
/
test-and-rebuild.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
name: "Build and Test"
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
cache:
name: Cache Dependencies
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Restore cache yarn
id: cache-yarn
uses: actions/cache@v2
with:
path: ~/.yarn
key: yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies [Main]
if: steps.cache-yarn.outputs.cache-hit != 'true'
run: yarn --cache-folder ~/.yarn
- name: Install dependencies [Example]
run: |
cd example
yarn --cache-folder ~/.yarn
- name: Restore cache gradle wrapper
id: cache-gradle-wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/gradle-wrapper.properties') }}
- name: Restore cache gradle cache
id: cache-gradle-cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-cache-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/settings.gradle') }}
- name: Downloading Gradle Dependencies
if: steps.cache-gradle-wrapper.outputs.cache-hit != 'true' || steps.cache-gradle-cache.outputs.cache-hit != 'true'
run: |
cd example/android
chmod +x gradlew
./gradlew --max-workers 2 downloadDependencies
- name: Restore cache Pods
id: cache-pods
uses: actions/cache@v1
with:
path: example/ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}
- name: Install CocoaPods
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
cd example/ios
pod install
analyse:
name: Analyse
needs: cache
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Restore cache yarn
uses: actions/cache@v2
with:
path: ~/.yarn
key: yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies [Main]
run: yarn --cache-folder ~/.yarn
- name: Test
run: yarn ci
build-android:
name: Build Android
needs: analyse
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Restore cache yarn
uses: actions/cache@v2
with:
path: ~/.yarn
key: yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
- name: Restore cache gradle wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/gradle-wrapper.properties') }}
- name: Restore cache gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-cache-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/settings.gradle') }}
- name: Install dependencies [Example]
run: |
cd example
yarn --cache-folder ~/.yarn
- name: Build Android Release
run: |
cd example
yarn detox build -c android.emu.release
- name: Test Android Release
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
avd-name: TestingAVD
script: cd example && yarn detox test -c android.emu.release -l info
build-ios:
name: Build iOS
needs: analyse
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Restore cache yarn
uses: actions/cache@v2
with:
path: ~/.yarn
key: yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
- name: Restore cache Pods
uses: actions/cache@v1
with:
path: example/ios/Pods
key: pods-${{ hashFiles('**/Podfile.lock') }}
- name: Install dependencies [Example]
run: |
cd example
yarn --cache-folder ~/.yarn
- name: Install Detox dependencies
run: |
cd example
brew tap wix/brew
brew install applesimutils
yarn detox clean-framework-cache
yarn detox build-framework-cache
- name: Install CocoaPods
run: |
cd example/ios
pod install
- name: Xcode Version
run: |
cd example
xcodebuild -version
xcrun simctl list
- name: Build iOS Release
run: |
cd example
yarn detox build -c ios.sim.release
- name: Test iOS Release
run: |
cd example
yarn detox test -c ios.sim.release -l info -u