33# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.
44
55version : 2.1
6+
7+ aliases :
8+ - &check-no-files-changed
9+ run :
10+ name : Check that no git-tracked files were modified
11+ command : |
12+ FILES_MODIFIED="$(git status --porcelain)"
13+ if [[ -n "$FILES_MODIFIED" ]]; then
14+ echo "The following files were modified or added during the build process:"
15+ echo "$FILES_MODIFIED"
16+ echo "This will likely prevent successful publishing. Please run the build locally and include these changes in your pull request. (If new files are created, consider whether they should be checked in or .gitignored.)"
17+ exit 1
18+ fi
19+
620jobs :
7- compile :
21+
22+ check :
823 docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
924 resource_class : large
1025 environment :
1126 CIRCLE_TEST_REPORTS : /home/circleci/junit
1227 CIRCLE_ARTIFACTS : /home/circleci/artifacts
1328 GRADLE_OPTS : -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
14- _JAVA_OPTIONS : -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
29+ _JAVA_OPTIONS : -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:+CrashOnOutOfMemoryError -XX: ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
1530 steps :
1631 - checkout
1732 - run :
@@ -38,133 +53,59 @@ jobs:
3853
3954 echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
4055 echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
41- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
42- - restore_cache : { key: 'compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
43- - run : ./gradlew --parallel --stacktrace classes testClasses -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
44- - save_cache :
45- key : ' gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
46- paths : [ ~/.gradle/wrapper ]
47- - save_cache :
48- key : ' compile-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
49- paths : [ ~/.gradle/caches ]
50- - store_test_results : { path: ~/junit }
51- - store_artifacts : { path: ~/artifacts }
56+ - restore_cache : { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
57+ - restore_cache : { key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
58+ - run :
59+ name : check-setup
60+ command : |
61+ if [ -x .circleci/check-setup.sh ]; then
62+ echo "Running check-setup" && .circleci/check-setup.sh && echo "check-setup complete"
63+ fi
64+ - run : ./gradlew --parallel --stacktrace --continue --max-workers=2 check -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
65+ - *check-no-files-changed
5266 - persist_to_workspace :
5367 root : /home/circleci
54- paths : [ project, .gradle/init.gradle ]
55-
56- check :
57- docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
58- resource_class : medium
59- environment :
60- CIRCLE_TEST_REPORTS : /home/circleci/junit
61- CIRCLE_ARTIFACTS : /home/circleci/artifacts
62- GRADLE_OPTS : -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
63- _JAVA_OPTIONS : -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
64- steps :
65- - attach_workspace : { at: /home/circleci }
66- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
67- - restore_cache : { key: 'check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
68- - run : ./gradlew --parallel --stacktrace --continue check idea -x test -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
68+ paths : [ project ]
6969 - save_cache :
70- key : ' check-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
71- paths : [ ~/.gradle/caches ]
72- - run :
73- command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
74- when : always
75- - store_test_results : { path: ~/junit }
76- - store_artifacts : { path: ~/artifacts }
77-
78- unit-test :
79- docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
80- resource_class : large
81- environment :
82- CIRCLE_TEST_REPORTS : /home/circleci/junit
83- CIRCLE_ARTIFACTS : /home/circleci/artifacts
84- GRADLE_OPTS : -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
85- _JAVA_OPTIONS : -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
86- steps :
87- - attach_workspace : { at: /home/circleci }
88- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
89- - restore_cache : { key: 'unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
90- - run : ./gradlew --parallel --stacktrace --continue --max-workers=2 test -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
91- - save_cache :
92- key : ' unit-test-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
93- paths : [ ~/.gradle/caches ]
94- - run :
95- command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
96- when : always
97- - store_test_results : { path: ~/junit }
98- - store_artifacts : { path: ~/artifacts }
99-
100- unit-test-11 :
101- docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
102- resource_class : large
103- environment :
104- CIRCLE_TEST_REPORTS : /home/circleci/junit
105- CIRCLE_ARTIFACTS : /home/circleci/artifacts
106- GRADLE_OPTS : -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
107- _JAVA_OPTIONS : -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
108- steps :
109- - checkout
110- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
111- - restore_cache : { key: 'unit-test-11-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
112- - run : ./gradlew --parallel --stacktrace --continue test -Pcom.palantir.baseline-error-prone.disable -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
70+ key : ' gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
71+ paths : [ ~/.gradle/wrapper ]
11372 - save_cache :
114- key : ' unit-test-11- gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
73+ key : ' check- gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
11574 paths : [ ~/.gradle/caches ]
11675 - run :
11776 command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
11877 when : always
11978 - store_test_results : { path: ~/junit }
12079 - store_artifacts : { path: ~/artifacts }
12180
122-
12381 build :
124- machine : { docker_layer_caching: true }
82+ machine :
83+ docker_layer_caching : true
12584 environment :
12685 CIRCLE_TEST_REPORTS : /home/circleci/junit
12786 CIRCLE_ARTIFACTS : /home/circleci/artifacts
12887 _JAVA_OPTIONS : -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Xmx8192m
12988 JAVA_HOME : /opt/java11
13089 steps :
131- - attach_workspace : { at: /home/circleci }
132- - restore_cache : { key: 'gradle-wrapper-v2 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
133- - restore_cache : { key: 'build-gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
90+ - checkout
91+ - restore_cache : { key: 'gradle-wrapper-v1 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
92+ - restore_cache : { key: 'build-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
13493 - run :
13594 name : Install Java 11
13695 command : |
13796 sudo mkdir -p /opt/java && cd /opt/java && sudo chown -R circleci:circleci .
138- curl https://cdn.azul.com/zulu/bin/zulu11.54.23 -ca-jdk11.0.14 -linux_x64.tar.gz | tar -xzf - -C /opt/java
97+ curl https://cdn.azul.com/zulu/bin/zulu11.70.15 -ca-jdk11.0.22 -linux_x64.tar.gz | tar -xzf - -C /opt/java
13998 sudo ln -s /opt/java/zulu*/ /opt/java11
140- - run : ./gradlew --parallel --stacktrace build -x test -x check -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
141- - save_cache :
142- key : ' build-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
143- paths : [ ~/.gradle/caches ]
14499 - run :
145- command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; || true
146- when : always
147- - store_test_results : { path: ~/junit }
148- - store_artifacts : { path: ~/artifacts }
149-
150- build-11 :
151- machine : { docker_layer_caching: true }
152- environment :
153- CIRCLE_TEST_REPORTS : /home/circleci/junit
154- CIRCLE_ARTIFACTS : /home/circleci/artifacts
155- JAVA_HOME : /opt/java11
156- _JAVA_OPTIONS : -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Xmx8192m
157- steps :
158- - attach_workspace : { at: /home/circleci }
159- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
160- - restore_cache : { key: 'build-11-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
161- - run : |
162- sudo mkdir -p /opt/java && cd /opt/java && sudo chown -R circleci:circleci .
163- curl https://cdn.azul.com/zulu/bin/zulu11.54.23-ca-jdk11.0.14-linux_x64.tar.gz | tar -xzf - -C /opt/java
164- sudo ln -s /opt/java/zulu*/ /opt/java11
165- - run : ./gradlew --parallel --stacktrace build -x test -x check -Pcom.palantir.baseline-error-prone.disable -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
100+ name : build-setup
101+ command : |
102+ if [ -x .circleci/build-setup.sh ]; then
103+ echo "Running build-setup" && .circleci/build-setup.sh && echo "build-setup complete"
104+ fi
105+ - run : ./gradlew --parallel --stacktrace build -x test -x check -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
106+ - *check-no-files-changed
166107 - save_cache :
167- key : ' build-11- gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
108+ key : ' build-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
168109 paths : [ ~/.gradle/caches ]
169110 - run :
170111 command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; || true
@@ -173,26 +114,10 @@ jobs:
173114 - store_artifacts : { path: ~/artifacts }
174115
175116 trial-publish :
176- docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
177- resource_class : medium
178- environment :
179- CIRCLE_TEST_REPORTS : /home/circleci/junit
180- CIRCLE_ARTIFACTS : /home/circleci/artifacts
181- GRADLE_OPTS : -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
182- _JAVA_OPTIONS : -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
117+ docker : [ { image: 'busybox:1.36.1@sha256:6d9ac9237a84afe1516540f40a0fafdc86859b2141954b4d643af7066d598b74' } ]
118+ resource_class : small
183119 steps :
184- - attach_workspace : { at: /home/circleci }
185- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
186- - restore_cache : { key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
187- - run : ./gradlew --stacktrace publishToMavenLocal -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
188- - run :
189- command : git status --porcelain
190- when : always
191- - save_cache :
192- key : ' trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
193- paths : [ ~/.gradle/caches ]
194- - store_test_results : { path: ~/junit }
195- - store_artifacts : { path: ~/artifacts }
120+ - run : { command: echo "Dummy job so repos that require the `trial-publish` job to merge PRs still see a passing `trial-publish`. Should be replaced by a `circle-all` job at some point." }
196121
197122 publish :
198123 docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
@@ -201,18 +126,18 @@ jobs:
201126 CIRCLE_TEST_REPORTS : /home/circleci/junit
202127 CIRCLE_ARTIFACTS : /home/circleci/artifacts
203128 GRADLE_OPTS : -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
204- _JAVA_OPTIONS : -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
129+ _JAVA_OPTIONS : -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:+CrashOnOutOfMemoryError -XX: ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
205130 steps :
206131 - attach_workspace : { at: /home/circleci }
207- - restore_cache : { key: 'gradle-wrapper-v2 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
208- - restore_cache : { key: 'publish-gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
132+ - restore_cache : { key: 'gradle-wrapper-v1 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
133+ - restore_cache : { key: 'publish-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
209134 - deploy :
210135 command : ./gradlew --parallel --stacktrace --continue publish -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
211136 - run :
212137 command : git status --porcelain
213138 when : always
214139 - save_cache :
215- key : ' publish-gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
140+ key : ' publish-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
216141 paths : [ ~/.gradle/caches ]
217142 - store_test_results : { path: ~/junit }
218143 - store_artifacts : { path: ~/artifacts }
@@ -222,32 +147,15 @@ workflows:
222147 version : 2
223148 build :
224149 jobs :
225- - compile :
226- filters : { tags: { only: /.*/ } }
227-
228- - unit-test :
229- requires : [ compile ]
230- filters : { tags: { only: /.*/ } }
231-
232- - unit-test-11 :
233- filters : { tags: { only: /.*/ } }
234-
235150 - check :
236- requires : [ compile ]
237151 filters : { tags: { only: /.*/ } }
238152
239153 - build :
240- requires : [ compile ]
241- filters : { tags: { only: /.*/ } }
242-
243- - build-11 :
244- requires : [ compile ]
245154 filters : { tags: { only: /.*/ } }
246155
247156 - trial-publish :
248- requires : [ compile ]
249157 filters : { branches: { ignore: master } }
250158
251159 - publish :
252- requires : [ unit-test, unit-test-11, check, build, build-11, trial-publish ]
160+ requires : [ check, trial-publish, build ]
253161 filters : { tags: { only: /.*/ }, branches: { only: master } }
0 commit comments