Skip to content

Commit e0204ae

Browse files
authored
Restore CircleCI configuration (#2959)
* Restore CircleCI configuration Signed-off-by: Marvin Froeder <velo.br@gmail.com> * Convert CircleCI to VM with SDKMAN Java installation for testcontainer support * Cache dependencies Signed-off-by: Marvin Froeder <velo.br@gmail.com> * Remove build githubaction Signed-off-by: Marvin Froeder <velo.br@gmail.com> --------- Signed-off-by: Marvin Froeder <velo.br@gmail.com>
1 parent 196f282 commit e0204ae

File tree

4 files changed

+301
-96
lines changed

4 files changed

+301
-96
lines changed

.circleci/config.yml

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
#
2+
# Copyright 2012-2020 The Feign Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
# in compliance with the License. You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software distributed under the License
10+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
# or implied. See the License for the specific language governing permissions and limitations under
12+
# the License.
13+
#
14+
15+
# common executors
16+
executors:
17+
java:
18+
machine:
19+
image: ubuntu-2204:2023.10.1
20+
21+
# common commands
22+
commands:
23+
setup-build-environment:
24+
description: 'Setup Java and Maven dependencies with unified caching'
25+
steps:
26+
- restore_cache:
27+
keys:
28+
- dependencies-v1-{{ checksum "pom.xml" }}
29+
- run:
30+
name: 'Check if cache was restored'
31+
command: |
32+
if [ -d "$HOME/.sdkman/candidates/java/21.0.2-tem" ] && [ -d ~/.m2/repository/io/github/openfeign ]; then
33+
echo "Complete cache hit detected - SDKMAN and Maven dependencies available."
34+
circleci step halt
35+
elif [ -d "$HOME/.sdkman/candidates/java/21.0.2-tem" ]; then
36+
echo "SDKMAN cache hit detected, but need to download Maven dependencies."
37+
elif [ -d ~/.m2/repository/io/github/openfeign ]; then
38+
echo "Maven cache hit detected, but need to install SDKMAN."
39+
else
40+
echo "No cache hit, setting up complete build environment."
41+
fi
42+
- run:
43+
name: 'Install SDKMAN!'
44+
command: |
45+
if [ ! -d "$HOME/.sdkman" ]; then
46+
curl -s "https://get.sdkman.io" | bash
47+
fi
48+
source "$HOME/.sdkman/bin/sdkman-init.sh"
49+
- run:
50+
name: 'Install JDKs (8, 11, 17, 21)'
51+
command: |
52+
source "$HOME/.sdkman/bin/sdkman-init.sh"
53+
jdk_versions=("8.0.382-tem" "11.0.22-tem" "17.0.10-tem" "21.0.2-tem")
54+
for jdk_version in "${jdk_versions[@]}"; do
55+
if [ ! -d "$HOME/.sdkman/candidates/java/$jdk_version" ]; then
56+
echo "n" | sdk install java "$jdk_version" || true
57+
fi
58+
done
59+
sdk default java 21.0.2-tem
60+
- run:
61+
name: 'Configure Maven Toolchain'
62+
command: |
63+
mkdir -p ~/.m2
64+
cp .circleci/toolchains.xml ~/.m2/toolchains.xml
65+
- run:
66+
name: 'Download Maven dependencies'
67+
command: |
68+
source "$HOME/.sdkman/bin/sdkman-init.sh"
69+
./mvnw -ntp -B \
70+
org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline \
71+
de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies \
72+
-T2 -pl -:feign-benchmark
73+
- save_cache:
74+
paths:
75+
- ~/.sdkman
76+
- ~/.m2
77+
key: dependencies-v1-{{ checksum "pom.xml" }}
78+
restore-build-environment:
79+
description: 'Restore cached build environment'
80+
steps:
81+
- restore_cache:
82+
keys:
83+
- dependencies-v1-{{ checksum "pom.xml" }}
84+
verify-formatting:
85+
steps:
86+
- run:
87+
name: 'Verify formatting'
88+
command: |
89+
scripts/no-git-changes.sh
90+
configure-gpg:
91+
steps:
92+
- run:
93+
name: 'Configure GPG keys'
94+
command: |
95+
echo -e "$GPG_KEY" | gpg --batch --no-tty --import --yes
96+
nexus-deploy:
97+
steps:
98+
- run:
99+
name: 'Deploy Core Modules Sonatype'
100+
command: |
101+
source "$HOME/.sdkman/bin/sdkman-init.sh"
102+
./mvnw -ntp -nsu -s .circleci/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy
103+
104+
# our job defaults
105+
defaults: &defaults
106+
working_directory: ~/feign
107+
environment:
108+
# Customize the JVM maximum heap limit
109+
MAVEN_OPTS: -Xmx3200m
110+
111+
# branch filters
112+
master-only: &master-only
113+
branches:
114+
only: master
115+
116+
tags-only: &tags-only
117+
branches:
118+
ignore: /.*/
119+
tags:
120+
only: /.*/
121+
122+
all-branches: &all-branches
123+
branches:
124+
ignore: master
125+
tags:
126+
ignore: /.*/
127+
128+
version: 2.1
129+
130+
jobs:
131+
setup-build-environment:
132+
executor:
133+
name: java
134+
<<: *defaults
135+
steps:
136+
- checkout
137+
- setup-build-environment
138+
139+
test:
140+
executor:
141+
name: java
142+
<<: *defaults
143+
steps:
144+
- checkout
145+
- restore-build-environment
146+
- run:
147+
name: 'Test'
148+
command: |
149+
source "$HOME/.sdkman/bin/sdkman-init.sh"
150+
./mvnw -ntp -B verify
151+
- verify-formatting
152+
153+
deploy:
154+
executor:
155+
name: java
156+
<<: *defaults
157+
steps:
158+
- checkout
159+
- restore-build-environment
160+
- configure-gpg
161+
- nexus-deploy
162+
163+
workflows:
164+
version: 2
165+
build:
166+
jobs:
167+
- setup-build-environment:
168+
name: 'setup-environment'
169+
filters:
170+
<<: *all-branches
171+
- test:
172+
name: 'pr-build'
173+
requires:
174+
- 'setup-environment'
175+
filters:
176+
<<: *all-branches
177+
178+
snapshot:
179+
jobs:
180+
- setup-build-environment:
181+
name: 'setup-environment-snapshot'
182+
filters:
183+
<<: *master-only
184+
- test:
185+
name: 'snapshot'
186+
requires:
187+
- 'setup-environment-snapshot'
188+
filters:
189+
<<: *master-only
190+
- deploy:
191+
name: 'deploy snapshot'
192+
requires:
193+
- 'snapshot'
194+
context: Sonatype
195+
filters:
196+
<<: *master-only
197+
198+
release:
199+
jobs:
200+
- setup-build-environment:
201+
name: 'setup-environment-release'
202+
filters:
203+
<<: *tags-only
204+
- deploy:
205+
name: 'release to maven central'
206+
requires:
207+
- 'setup-environment-release'
208+
context: Sonatype
209+
filters:
210+
<<: *tags-only

.circleci/settings.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
3+
Copyright 2012-2019 The Feign Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
15+
-->
16+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
17+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
19+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
20+
<servers>
21+
<server>
22+
<id>ossrh</id>
23+
<username>${env.SONATYPE_USER}</username>
24+
<password>${env.SONATYPE_PASSWORD}</password>
25+
</server>
26+
</servers>
27+
<profiles>
28+
<profile>
29+
<id>ossrh</id>
30+
<activation>
31+
<activeByDefault>true</activeByDefault>
32+
</activation>
33+
<properties>
34+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
35+
</properties>
36+
</profile>
37+
</profiles>
38+
</settings>

.circleci/toolchains.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!--
2+
3+
Copyright 2012-2019 The Feign Authors
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
in compliance with the License. You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License
11+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
or implied. See the License for the specific language governing permissions and limitations under
13+
the License.
14+
15+
-->
16+
<toolchains>
17+
<toolchain>
18+
<type>jdk</type>
19+
<provides>
20+
<version>1.8</version>
21+
</provides>
22+
<configuration>
23+
<jdkHome>/home/circleci/.sdkman/candidates/java/8.0.382-tem</jdkHome>
24+
</configuration>
25+
</toolchain>
26+
<toolchain>
27+
<type>jdk</type>
28+
<provides>
29+
<version>11</version>
30+
</provides>
31+
<configuration>
32+
<jdkHome>/home/circleci/.sdkman/candidates/java/11.0.22-tem</jdkHome>
33+
</configuration>
34+
</toolchain>
35+
<toolchain>
36+
<type>jdk</type>
37+
<provides>
38+
<version>17</version>
39+
</provides>
40+
<configuration>
41+
<jdkHome>/home/circleci/.sdkman/candidates/java/17.0.10-tem</jdkHome>
42+
</configuration>
43+
</toolchain>
44+
<toolchain>
45+
<type>jdk</type>
46+
<provides>
47+
<version>21</version>
48+
</provides>
49+
<configuration>
50+
<jdkHome>/home/circleci/.sdkman/candidates/java/21.0.2-tem</jdkHome>
51+
</configuration>
52+
</toolchain>
53+
</toolchains>

0 commit comments

Comments
 (0)