forked from AnySoftKeyboard/AnySoftKeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
218 lines (171 loc) · 6.18 KB
/
circle.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
version: 2.0
references:
container_config: &container_config
docker:
- image: menny/ndk_ask:1.10.0
working_directory: /opt/workspace/
environment: &base_environment
TERM: dumb
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
resource_class: large
general_cache_key: &general_cache_key
key: anysoftkeyboard-{{ checksum "build.gradle" }}-{{ checksum "settings.gradle"}}-{{ checksum "app/build.gradle" }}-{{ checksum "circle.yml" }}-{{ checksum "gradle.properties" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
check_cache_key: &check_cache_key
key: anysoftkeyboard-check-{{ checksum "build.gradle" }}-{{ checksum "settings.gradle"}}-{{ checksum "app/build.gradle" }}-{{ checksum "circle.yml" }}-{{ checksum "gradle.properties" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
test_cache_key: &test_cache_key
key: anysoftkeyboard-test-{{ checksum "build.gradle" }}-{{ checksum "settings.gradle"}}-{{ checksum "app/build.gradle" }}-{{ checksum "circle.yml" }}-{{ checksum "gradle.properties" }}-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
cache_paths: &cache_paths
paths:
- "~/.gradle"
- "~/.m2"
- "/opt/android-sdk-linux/licenses/"
test_template: &test_template
<<: *container_config
environment: &test_environment
<<: *base_environment
CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e
GRADLE_OPTS: "-Dorg.gradle.daemon=false -DmaxTestForks=3 -DTEST_FORK_EVERY=20"
resource_class: xlarge
steps:
- checkout
- restore_cache:
<<: *test_cache_key
- run:
name: Run Tests
command: |
export TEST_GROUP_INDEX=${CIRCLE_NODE_INDEX}
export TEST_GROUPS_COUNT=${CIRCLE_NODE_TOTAL}
echo "Running test group ${TEST_GROUP_INDEX} out of ${TEST_GROUPS_COUNT}..."
./scripts/ci/ci_test.sh
curl https://codecov.io/bash -o codecov.sh
chmod +x codecov.sh
./codecov.sh -X gcov -X coveragepy -X xcode \
-f app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f base/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f base-rx/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f dictioneries/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f nextword/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f pixel/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml \
-f prefs/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml
- store_artifacts:
path: app/build/reports/tests/
destination: tests_reports/
- store_test_results:
path: /opt/workspace/app/build/test-results
- save_cache:
<<: *test_cache_key
<<: *cache_paths
deploy_template: &deploy_template
<<: *container_config
steps:
- checkout
- restore_cache:
<<: *general_cache_key
- run:
name: Deploy to Play Store
command: scripts/ci/ci_deploy.sh ${UPLOAD_KEYSTORE_FILE_URL} ${PUBLISH_CERT_FILE_URL} ${CIRCLE_PROJECT_USERNAME} ${BUILD_TYPE}
- store_artifacts:
path: /opt/workspace/app/build/outputs/apk/
destination: apks/
- store_artifacts:
path: /opt/workspace/app/build/outputs/mapping/
destination: mapping/
jobs:
build:
<<: *container_config
steps:
- checkout
- restore_cache:
<<: *general_cache_key
- run:
name: Setup environment
command: scripts/ci/ci_setup.sh
- run:
name: Initial build
command: scripts/ci/ci_assemble.sh
- store_artifacts:
path: /opt/workspace/app/build/outputs/apk/
destination: apks/
- save_cache:
<<: *general_cache_key
<<: *cache_paths
check:
<<: *container_config
steps:
- checkout
- restore_cache:
<<: *check_cache_key
- run:
name: Run Checks
command: scripts/ci/ci_check.sh
- store_artifacts:
path: /opt/workspace/app/build/reports/
destination: lint_reports/app/
- store_artifacts:
path: /opt/workspace/base/build/reports/
destination: lint_reports/base/
- store_artifacts:
path: /opt/workspace/base-rx/build/reports/
destination: lint_reports/base-rx/
- store_artifacts:
path: /opt/workspace/jnidictionaryv1/build/reports/
destination: lint_reports/jnidictionaryv1/
- store_artifacts:
path: /opt/workspace/jnidictionaryv2/build/reports/
destination: lint_reports/jnidictionaryv2/
- store_artifacts:
path: /opt/workspace/nextword/build/reports/
destination: lint_reports/nextword/
- store_artifacts:
path: /opt/workspace/pixel/build/reports/
destination: lint_reports/pixel/
- store_artifacts:
path: /opt/workspace/prefs/build/reports/
destination: lint_reports/prefs/
- save_cache:
<<: *check_cache_key
<<: *cache_paths
test:
<<: *test_template
environment:
<<: *test_environment
parallelism: 3
deploy_release:
<<: *deploy_template
environment:
<<: *base_environment
BUILD_TYPE: "release"
deploy_canary:
<<: *deploy_template
environment:
<<: *base_environment
BUILD_TYPE: "canary"
workflows:
version: 2
build_check_tests_deploy:
jobs:
- build
- check:
requires:
- build
- test:
requires:
- build
- deploy_release:
filters:
branches:
only:
- /release-branch-v.*/
requires:
- build
- check
- test
- deploy_canary:
filters:
branches:
only:
- master
requires:
- build
- check
- test