3
3
# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.
4
4
5
5
version : 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
+
6
20
jobs :
7
- compile :
21
+
22
+ check :
8
23
docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
9
24
resource_class : large
10
25
environment :
11
26
CIRCLE_TEST_REPORTS : /home/circleci/junit
12
27
CIRCLE_ARTIFACTS : /home/circleci/artifacts
13
28
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
15
30
steps :
16
31
- checkout
17
32
- run :
@@ -38,86 +53,59 @@ jobs:
38
53
39
54
echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
40
55
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
52
66
- persist_to_workspace :
53
67
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 ]
69
69
- 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
70
+ key : ' gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
71
+ paths : [ ~/.gradle/wrapper ]
91
72
- save_cache :
92
- key : ' unit-test- gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
73
+ key : ' check- gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
93
74
paths : [ ~/.gradle/caches ]
94
75
- run :
95
76
command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
96
77
when : always
97
78
- store_test_results : { path: ~/junit }
98
79
- store_artifacts : { path: ~/artifacts }
99
80
100
-
101
81
build :
102
- machine : { docker_layer_caching: true }
82
+ machine :
83
+ docker_layer_caching : true
103
84
environment :
104
85
CIRCLE_TEST_REPORTS : /home/circleci/junit
105
86
CIRCLE_ARTIFACTS : /home/circleci/artifacts
106
87
_JAVA_OPTIONS : -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Xmx8192m
107
88
JAVA_HOME : /opt/java11
108
89
steps :
109
- - attach_workspace : { at: /home/circleci }
110
- - restore_cache : { key: 'gradle-wrapper-v2 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
111
- - 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" }}' }
112
93
- run :
113
94
name : Install Java 11
114
95
command : |
115
96
sudo mkdir -p /opt/java && cd /opt/java && sudo chown -R circleci:circleci .
116
- 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
117
98
sudo ln -s /opt/java/zulu*/ /opt/java11
99
+ - run :
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
118
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
119
107
- save_cache :
120
- key : ' build-gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
108
+ key : ' build-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
121
109
paths : [ ~/.gradle/caches ]
122
110
- run :
123
111
command : mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \; || true
@@ -126,26 +114,10 @@ jobs:
126
114
- store_artifacts : { path: ~/artifacts }
127
115
128
116
trial-publish :
129
- docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
130
- resource_class : medium
131
- environment :
132
- CIRCLE_TEST_REPORTS : /home/circleci/junit
133
- CIRCLE_ARTIFACTS : /home/circleci/artifacts
134
- 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'
135
- _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
136
119
steps :
137
- - attach_workspace : { at: /home/circleci }
138
- - restore_cache : { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
139
- - restore_cache : { key: 'trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
140
- - run : ./gradlew --stacktrace publishToMavenLocal -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
141
- - run :
142
- command : git status --porcelain
143
- when : always
144
- - save_cache :
145
- key : ' trial-publish-gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
146
- paths : [ ~/.gradle/caches ]
147
- - store_test_results : { path: ~/junit }
148
- - 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." }
149
121
150
122
publish :
151
123
docker : [{ image: 'cimg/openjdk:11.0.10-node' }]
@@ -154,18 +126,18 @@ jobs:
154
126
CIRCLE_TEST_REPORTS : /home/circleci/junit
155
127
CIRCLE_ARTIFACTS : /home/circleci/artifacts
156
128
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'
157
- _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
158
130
steps :
159
131
- attach_workspace : { at: /home/circleci }
160
- - restore_cache : { key: 'gradle-wrapper-v2 -{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
161
- - 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" }}' }
162
134
- deploy :
163
135
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
164
136
- run :
165
137
command : git status --porcelain
166
138
when : always
167
139
- save_cache :
168
- key : ' publish-gradle-cache-v2 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
140
+ key : ' publish-gradle-cache-v1 -{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
169
141
paths : [ ~/.gradle/caches ]
170
142
- store_test_results : { path: ~/junit }
171
143
- store_artifacts : { path: ~/artifacts }
@@ -175,25 +147,15 @@ workflows:
175
147
version : 2
176
148
build :
177
149
jobs :
178
- - compile :
179
- filters : { tags: { only: /.*/ } }
180
-
181
- - unit-test :
182
- requires : [ compile ]
183
- filters : { tags: { only: /.*/ } }
184
-
185
150
- check :
186
- requires : [ compile ]
187
151
filters : { tags: { only: /.*/ } }
188
152
189
153
- build :
190
- requires : [ compile ]
191
154
filters : { tags: { only: /.*/ } }
192
155
193
156
- trial-publish :
194
- requires : [ compile ]
195
157
filters : { branches: { ignore: develop } }
196
158
197
159
- publish :
198
- requires : [ unit-test, check, build, trial-publish ]
160
+ requires : [ check, trial-publish, build ]
199
161
filters : { tags: { only: /.*/ }, branches: { only: develop } }
0 commit comments