forked from AnySoftKeyboard/AnySoftKeyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
194 lines (155 loc) · 5.04 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
version: 2.0
references:
container_config: &container_config
docker:
- image: menny/ndk_ask:1.9.2
working_directory: /opt/workspace/
environment: &base_environment
TERM: dumb
_JAVA_OPTIONS: "-Xmx2200m"
general_cache_key: &general_cache_key
key: anysoftkeyboard-{{ checksum "build.gradle" }}-{{ checksum "gradle/root_general.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 "gradle/root_general.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
COV_REPORT_LOCATION: app/build/reports/jacoco/testDebugUnitTestCoverage/testDebugUnitTestCoverage.xml
CODECOV_TOKEN: 1a4cd171-2784-4f48-8a62-0b7ec31e6d7e
_JAVA_OPTIONS: "-Xmx1600m"
parallelism: 4
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
if [[ -f $COV_REPORT_LOCATION ]]; then
curl https://codecov.io/bash -o codecov.sh
chmod +x codecov.sh
./codecov.sh -X gcov -X coveragepy -f ${COV_REPORT_LOCATION}
fi
- 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_check:
<<: *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/
- 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/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/
- save_cache:
<<: *general_cache_key
<<: *cache_paths
test_small:
<<: *test_template
environment:
<<: *test_environment
TEST_FORKS: "2"
TEST_FORK_EVERY: "7"
ONLY_HEAVY_TESTS: "false"
test_heavy:
<<: *test_template
environment:
<<: *test_environment
TEST_FORKS: "1"
TEST_FORK_EVERY: "3"
ONLY_HEAVY_TESTS: "true"
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
- test_small:
requires:
- build_check
- test_heavy:
requires:
- build_check
- deploy_release:
filters:
branches:
only:
- release-branch
requires:
- build_check
- test_small
- test_heavy
- deploy_canary:
filters:
branches:
only:
- master
requires:
- build_check
- test_small
- test_heavy