-
Notifications
You must be signed in to change notification settings - Fork 455
/
config.yml
161 lines (156 loc) · 5 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
version: 2.1
orbs:
win: circleci/[email protected]
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-wrapper2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
restore_cache_deps: &restore_cache_deps
restore_cache:
keys:
- gradle-deps3-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
- gradle-deps3-
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 -x spotlessCheck
command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check -x spotlessCheck --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
- store_artifacts:
path: lib/build/spotbugs
- store_artifacts:
path: lib-extra/build/spotbugs
- store_artifacts:
path: testlib/build/spotbugs
- store_artifacts:
path: plugin-gradle/build/spotbugs
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
- save_cache:
paths:
- ~/.gradle/wrapper
key: gradle-wrapper2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
- save_cache:
paths:
- ~/.gradle/caches
- ~/.m2
key: gradle-deps3-{{ 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_17:
# latest JDK
<<: *env_gradle_large
docker:
- image: cimg/openjdk:17.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 testNpm
command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew testNpm --build-cache
- store_test_results:
path: testlib/build/test-results/testNpm
- store_test_results:
path: plugin-maven/build/test-results/testNpm
- store_test_results:
path: plugin-gradle/build/test-results/testNpm
- run:
name: gradlew test
command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew test --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
test_windows:
executor:
name: win/default
shell: cmd.exe
steps:
- checkout
- run:
name: gradlew test
command: gradlew test --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
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_17:
requires:
- assemble_testClasses
- test_npm_8:
requires:
- assemble_testClasses