-
Notifications
You must be signed in to change notification settings - Fork 10
194 lines (192 loc) · 5.84 KB
/
ci-build-and-test.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
name: Build and test
on:
pull_request:
push:
branches:
- develop
- main
workflow_dispatch:
workflow_run:
workflows: ["Upgrade all dependencies"]
types:
- completed
env:
android-adb-command-timeout-milliseconds: 20_000L
android-api-level: 31
android-avd-name: Pixel_3_API_S_1
android-avd-ram-size: 1024M
android-promise-timeout-milliseconds: 75_000L
android-sdk-root: /Users/ely/Library/Android/sdk
node-version: 14
jobs:
build-typescript-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.node-version }}
- run: TARGET=typescript make clean build
if: steps.node_modules.outputs.cache-hit != 'true'
build-typescript-macos:
runs-on: m1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.node-version }}
- run: TARGET=typescript make clean build
if: steps.node_modules.outputs.cache-hit != 'true'
build-typescript-lint:
needs:
- build-typescript-linux
- build-typescript-macos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.node-version }}
- run: TARGET=typescript make lint
run-typescript-tests:
needs: build-typescript-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ env.node-version }}
- run: TARGET=typescript make test
- uses: actions/upload-artifact@v2
with:
name: ts-test-results
path: output/typescript-test-output.xml
run-android-lint:
needs:
- build-typescript-linux
- build-typescript-macos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=android make clean lint
run-android-unit-tests:
needs: run-android-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=android:unit make clean test
- uses: actions/upload-artifact@v2
with:
name: android-unit-test-results
path: android/build/test-results/**/*.xml
run-android-instrumented-tests:
needs: run-android-lint
continue-on-error: true
runs-on: m1
steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- uses: reactivecircus/[email protected]
env:
ANDROID_SDK_ROOT: ${{ env.android-sdk-root }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_ADB_COMMAND_TIMEOUT_MILLISECONDS: ${{ env.android-adb-command-timeout-milliseconds }}
ORG_GRADLE_PROJECT_PROMISE_TIMEOUT_MILLISECONDS: ${{ env.android-promise-timeout-milliseconds }}
TARGET: android:instrumented
with:
api-level: ${{ env.android-api-level }}
arch: arm64-v8a
avd-name: ${{ env.android-avd-name }}
emulator-options: -no-snapshot -noaudio -no-boot-anim
force-avd-creation: false
ram-size: ${{ env.android-avd-ram-size }}
script: |
adb logcat -c
adb logcat | tee android_instrumented_logcat.log | grep 'io.deckers.blob_courier' &
make clean test
target: google_apis
- uses: actions/upload-artifact@v2
with:
name: android-instrumented-test-results
path: android/build/outputs/androidTest-results/connected/**/*.xml
if: always()
- uses: actions/upload-artifact@v2
with:
name: android-instrumented-logcat
path: android_instrumented_logcat.log
if: always()
run-ios-lint:
needs:
- build-typescript-linux
- build-typescript-macos
runs-on: m1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=ios make lint
run-ios-tests:
needs: run-ios-lint
runs-on: m1
steps:
- uses: actions/checkout@v2
- run: xcrun simctl boot "iPhone 11" || true
- uses: actions/cache@v2
id: node_modules
with:
path: node_modules
key: yarn-${{ hashFiles('**/yarn.lock') }}
- run: TARGET=ios:gui make clean test
- uses: actions/upload-artifact@v2
with:
name: ios-test-results
path: build/reports/**/*.xml