-
Notifications
You must be signed in to change notification settings - Fork 447
/
config.yml
356 lines (352 loc) · 10.9 KB
/
config.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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
version: 2.1
orbs:
win: circleci/windows@2.4.0
anchors:
env_gradle: &env_gradle
environment:
# we're only allowed to use 2 vCPUs
GRADLE_OPTS: "-Dorg.gradle.workers.max=2"
docker:
- image: cimg/openjdk:11.0
env_gradle_large: &env_gradle_large
<< : *env_gradle
resource_class: large # https://circleci.com/docs/2.0/configuration-reference/#resource_class
environment:
GRADLE_OPTS: "-Dorg.gradle.workers.max=4"
restore_cache_wrapper: &restore_cache_wrapper
restore_cache:
key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
restore_cache_deps: &restore_cache_deps
restore_cache:
keys:
- gradle-deps2-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
- gradle-deps2-
set_git_origin_to_https: &set_git_origin_to_https
run:
name: set git origin to https
command: git remote set-url --push origin https://github.com/diffplug/spotless
test_nomaven: &test_nomaven
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew check
command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check --build-cache
- store_test_results:
path: testlib/build/test-results/test
- store_test_results:
path: lib-extra/build/test-results/test
- store_test_results:
path: plugin-gradle/build/test-results/test
jobs:
# gradlew spotlessCheck assemble testClasses
assemble_testClasses:
<<: *env_gradle_large
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew spotlessCheck assemble testClasses
command: ./gradlew spotlessCheck assemble testClasses --build-cache
- run:
name: prepare to cache
command: rm -rf ~/project/plugin-maven/build/localMavenRepository/com/diffplug/spotless/
- save_cache:
paths:
- ~/.gradle/wrapper
key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
- save_cache:
paths:
- ~/.gradle/caches
- ~/.m2
- ~/project/plugin-maven/build/localMavenRepository
key: gradle-deps2-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
test_nomaven_11:
# latest LTS version
<<: *env_gradle_large
docker:
- image: cimg/openjdk:11.0
<<: *test_nomaven
test_nomaven_15:
# latest JDK, replace with 16 when it comes out
<<: *env_gradle_large
docker:
- image: cimg/openjdk:15.0
<<: *test_nomaven
test_justmaven_11:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew :plugin-maven:check
command: ./gradlew :plugin-maven:check --build-cache
- store_test_results:
path: plugin-maven/build/test-results/test
test_npm_8:
<< : *env_gradle
environment:
# java doesn't play nice with containers, it tries to hog the entire machine
# https://circleci.com/blog/how-to-handle-java-oom-errors/
# try the experimental JVM option
_JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
docker:
- image: cimg/openjdk:8.0-node
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew npmTest
command: ./gradlew npmTest --build-cache
- store_test_results:
path: testlib/build/test-results/npm
- store_test_results:
path: plugin-maven/build/test-results/npm
- store_test_results:
path: plugin-gradle/build/test-results/npm
test_windows:
executor:
name: win/default
shell: cmd.exe
steps:
- checkout
- run:
name: install
command: choco install ojdkbuild8
- run:
name: gradlew check
command: gradlew check --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true
- store_test_results:
path: testlib/build/test-results/test
- store_test_results:
path: lib-extra/build/test-results/test
- store_test_results:
path: plugin-gradle/build/test-results/test
- run:
name: gradlew npmTest
command: gradlew npmTest --build-cache -PSPOTLESS_EXCLUDE_MAVEN=true
- store_test_results:
path: testlib/build/test-results/npm
- store_test_results:
path: plugin-gradle/build/test-results/npm
changelog_print:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew changelogPrint
command: ./gradlew changelogPrint
do_release_all:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :changelogPush
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace --warning-mode all
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all
do_release_lib:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :changelogPush
command: ./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all
do_release_plugin_gradle:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret} --stacktrace
do_release_plugin_maven:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace
ext_changelog_print:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true changelogPrint
ext_do_release_base:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-base:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-base:changelogPush -Prelease=true --stacktrace
ext_do_release_jdt:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-jdt:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.nop2=true :eclipse-jdt:changelogPush -Prelease=true --stacktrace
ext_do_release_cdt:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-cdt:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.cdt=true :eclipse-cdt:changelogPush -Prelease=true --stacktrace
ext_do_release_groovy:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-groovy:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.groovy=true :eclipse-groovy:changelogPush -Prelease=true --stacktrace
ext_do_release_wtp:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- *set_git_origin_to_https
- run:
name: gradlew :eclipse-wtp:changelogPush
command: ./gradlew -Pcom.diffplug.spotless.include.ext.wtp=true :eclipse-wtp:changelogPush -Prelease=true --stacktrace
workflows:
version: 2
assemble_and_test:
jobs:
- test_windows
- assemble_testClasses
- test_justmaven_11:
requires:
- assemble_testClasses
- test_nomaven_11:
requires:
- assemble_testClasses
- test_nomaven_15:
requires:
- assemble_testClasses
- test_npm_8:
requires:
- assemble_testClasses
deploy:
jobs:
- changelog_print:
filters:
branches:
only: main
- release_all:
type: approval
requires:
- changelog_print
- do_release_all:
requires:
- release_all
- release_plugin_gradle:
type: approval
requires:
- changelog_print
- do_release_plugin_gradle:
requires:
- release_plugin_gradle
- release_plugin_maven:
type: approval
requires:
- changelog_print
- do_release_plugin_maven:
requires:
- release_plugin_maven
- release_lib:
type: approval
requires:
- changelog_print
- do_release_lib:
requires:
- release_lib
ext_deploy:
jobs:
- ext_changelog_print:
filters:
branches:
only: main
- ext_release_base:
type: approval
requires:
- ext_changelog_print
- ext_do_release_base:
requires:
- ext_release_base
- ext_release_jdt:
type: approval
requires:
- ext_changelog_print
- ext_do_release_jdt:
requires:
- ext_release_jdt
- ext_release_cdt:
type: approval
requires:
- ext_changelog_print
- ext_do_release_cdt:
filters:
branches:
only: main
requires:
- ext_release_cdt
- ext_release_groovy:
type: approval
requires:
- ext_changelog_print
- ext_do_release_groovy:
filters:
branches:
only: main
requires:
- ext_release_groovy
- ext_release_wtp:
type: approval
requires:
- ext_changelog_print
- ext_do_release_wtp:
filters:
branches:
only: main
requires:
- ext_release_wtp