generated from reime005/ReactNativeAnimatedBase
-
Notifications
You must be signed in to change notification settings - Fork 17
292 lines (239 loc) · 8.65 KB
/
ci.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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
name: CI
on: [push, pull_request]
jobs:
setup-and-tests:
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Specify node version
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Post Install
env:
GOOGLE_MAPS_KEY_ANDROID: ${{ secrets.GOOGLE_MAPS_KEY_ANDROID }}
run: |
sed -i.bak ''s/REPLACE_BUILD_NUMBER/${GITHUB_RUN_NUMBER}/'' .env
sed -i.bak ''s/REPLACE_MAPS_KEY/${GOOGLE_MAPS_KEY_ANDROID}/'' .env
- name: Install deps
run: |
yarn --frozen-lockfile --network-timeout 1000000
- name: Lint
run: |
yarn lint:ci
- name: Unit Tests
run: |
yarn test
e2e-ios:
needs: setup-and-tests
runs-on: macos-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Specify node version
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install deps
run: |
yarn --frozen-lockfile --network-timeout 1000000
- name: Cocoapod install
run: |
npx pod-install ios
- name: Post Install
env:
GOOGLE_MAPS_KEY_ANDROID: ${{ secrets.GOOGLE_MAPS_KEY_ANDROID }}
run: |
sed -i.bak ''s/REPLACE_BUILD_NUMBER/${GITHUB_RUN_NUMBER}/'' .env
sed -i.bak ''s/REPLACE_MAPS_KEY/${GOOGLE_MAPS_KEY_ANDROID}/'' .env
- name: Detox setup
run: |
brew tap wix/brew
brew install applesimutils
- name: Build
run: |
yarn build:ios-release
- name: E2E test
timeout-minutes: 15
run: |
npx detox clean-framework-cache && npx detox build-framework-cache
yarn test:ios-release
e2e-android:
needs: setup-and-tests
runs-on: macos-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Specify node version
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install deps
run: |
yarn --frozen-lockfile --network-timeout 1000000
- name: Post Install
env:
GOOGLE_MAPS_KEY_ANDROID: ${{ secrets.GOOGLE_MAPS_KEY_ANDROID }}
run: |
sed -i.bak ''s/REPLACE_BUILD_NUMBER/${GITHUB_RUN_NUMBER}/'' .env
sed -i.bak ''s/REPLACE_MAPS_KEY/${GOOGLE_MAPS_KEY_ANDROID}/'' .env
mkdir -p ./artifacts
- name: Use specific Java version for sdkmanager to work
uses: joschi/setup-jdk@v2
with:
java-version: '8'
architecture: 'x64'
- name: Build
working-directory: android
env:
KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
AT: ${{ secrets.ANDROID_TOKEN }}
ANDROID_KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
run: |
echo "$KEYSTORE" | base64 -d > ./release.keystore
echo "$AT" | base64 -d > ./play.json
echo "$ANDROID_KEYSTORE_PROPERTIES" | base64 -d > ./keystore.properties
yarn build:android-release
- name: Download Android Emulator Image
run: |
echo y | sudo $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-28;google_apis;x86_64" > /dev/null
$ANDROID_HOME/tools/bin/avdmanager -s create avd -n emu -k "system-images;android-28;google_apis;x86_64" -c 512M -d "Nexus S" -f
- name: Start Emulator
timeout-minutes: 15
run: |
export PATH=$PATH:$ANDROID_HOME/platform-tools
$ANDROID_HOME/emulator/emulator @emu -no-boot-anim &
adb wait-for-device; adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'; adb shell wm dismiss-keyguard
- name: Test
timeout-minutes: 15
run: |
yarn test:android-release --record-videos all
- uses: actions/upload-artifact@v1
if: always()
with:
name: e2e-test-videos
path: artifacts
deploy-ios:
needs: e2e-ios
runs-on: macos-latest
if: "github.ref == 'refs/heads/master'"
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Specify node version
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install deps
run: |
yarn --frozen-lockfile --network-timeout 1000000
- name: Cocoapod install
run: |
npx pod-install ios
- name: Post Install
env:
GOOGLE_MAPS_KEY_ANDROID: ${{ secrets.GOOGLE_MAPS_KEY_ANDROID }}
run: |
sed -i.bak ''s/REPLACE_BUILD_NUMBER/${GITHUB_RUN_NUMBER}/'' .env
sed -i.bak ''s/REPLACE_MAPS_KEY/${GOOGLE_MAPS_KEY_ANDROID}/'' .env
- name: Fastlane setup
working-directory: ios
run: |
bundle install
- name: Deploy iOS & Upload to TestFlight
working-directory: ios
env:
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
PAT: ${{ secrets.PAT }}
run: |
bundle exec fastlane ios beta_ci
deploy-android:
needs: e2e-android
runs-on: macos-latest
if: "github.ref == 'refs/heads/master'"
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Specify node version
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install deps
run: |
yarn --frozen-lockfile --network-timeout 1000000
- name: Post Install
env:
GOOGLE_MAPS_KEY_ANDROID: ${{ secrets.GOOGLE_MAPS_KEY_ANDROID }}
run: |
sed -i.bak ''s/REPLACE_BUILD_NUMBER/${GITHUB_RUN_NUMBER}/'' .env
sed -i.bak ''s/REPLACE_MAPS_KEY/${GOOGLE_MAPS_KEY_ANDROID}/'' .env
- name: Fastlane setup
run: |
cd android; bundle install
- name: Deploy Android Bundle & Upload to Beta Test Track
working-directory: android
env:
KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
AT: ${{ secrets.ANDROID_TOKEN }}
ANDROID_KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
run: |
echo "$KEYSTORE" | base64 -d > ./release.keystore
echo "$AT" | base64 -d > ./play.json
echo "$ANDROID_KEYSTORE_PROPERTIES" | base64 -d > ./keystore.properties
bundle exec fastlane android beta