Skip to content

Restore CircleCI configuration #2959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 210 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
#
# Copyright 2012-2020 The Feign Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#

# common executors
executors:
java:
machine:
image: ubuntu-2204:2023.10.1

# common commands
commands:
setup-build-environment:
description: 'Setup Java and Maven dependencies with unified caching'
steps:
- restore_cache:
keys:
- dependencies-v1-{{ checksum "pom.xml" }}
- run:
name: 'Check if cache was restored'
command: |
if [ -d "$HOME/.sdkman/candidates/java/21.0.2-tem" ] && [ -d ~/.m2/repository/io/github/openfeign ]; then
echo "Complete cache hit detected - SDKMAN and Maven dependencies available."
circleci step halt
elif [ -d "$HOME/.sdkman/candidates/java/21.0.2-tem" ]; then
echo "SDKMAN cache hit detected, but need to download Maven dependencies."
elif [ -d ~/.m2/repository/io/github/openfeign ]; then
echo "Maven cache hit detected, but need to install SDKMAN."
else
echo "No cache hit, setting up complete build environment."
fi
- run:
name: 'Install SDKMAN!'
command: |
if [ ! -d "$HOME/.sdkman" ]; then
curl -s "https://get.sdkman.io" | bash
fi
source "$HOME/.sdkman/bin/sdkman-init.sh"
- run:
name: 'Install JDKs (8, 11, 17, 21)'
command: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
jdk_versions=("8.0.382-tem" "11.0.22-tem" "17.0.10-tem" "21.0.2-tem")
for jdk_version in "${jdk_versions[@]}"; do
if [ ! -d "$HOME/.sdkman/candidates/java/$jdk_version" ]; then
echo "n" | sdk install java "$jdk_version" || true
fi
done
sdk default java 21.0.2-tem
- run:
name: 'Configure Maven Toolchain'
command: |
mkdir -p ~/.m2
cp .circleci/toolchains.xml ~/.m2/toolchains.xml
- run:
name: 'Download Maven dependencies'
command: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
./mvnw -ntp -B \
org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline \
de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies \
-T2 -pl -:feign-benchmark
- save_cache:
paths:
- ~/.sdkman
- ~/.m2
key: dependencies-v1-{{ checksum "pom.xml" }}
restore-build-environment:
description: 'Restore cached build environment'
steps:
- restore_cache:
keys:
- dependencies-v1-{{ checksum "pom.xml" }}
verify-formatting:
steps:
- run:
name: 'Verify formatting'
command: |
scripts/no-git-changes.sh
configure-gpg:
steps:
- run:
name: 'Configure GPG keys'
command: |
echo -e "$GPG_KEY" | gpg --batch --no-tty --import --yes
nexus-deploy:
steps:
- run:
name: 'Deploy Core Modules Sonatype'
command: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
./mvnw -ntp -nsu -s .circleci/settings.xml -P release -pl -:feign-benchmark -DskipTests=true deploy

# our job defaults
defaults: &defaults
working_directory: ~/feign
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m

# branch filters
master-only: &master-only
branches:
only: master

tags-only: &tags-only
branches:
ignore: /.*/
tags:
only: /.*/

all-branches: &all-branches
branches:
ignore: master
tags:
ignore: /.*/

version: 2.1

jobs:
setup-build-environment:
executor:
name: java
<<: *defaults
steps:
- checkout
- setup-build-environment

test:
executor:
name: java
<<: *defaults
steps:
- checkout
- restore-build-environment
- run:
name: 'Test'
command: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
./mvnw -ntp -B verify
- verify-formatting

deploy:
executor:
name: java
<<: *defaults
steps:
- checkout
- restore-build-environment
- configure-gpg
- nexus-deploy

workflows:
version: 2
build:
jobs:
- setup-build-environment:
name: 'setup-environment'
filters:
<<: *all-branches
- test:
name: 'pr-build'
requires:
- 'setup-environment'
filters:
<<: *all-branches

snapshot:
jobs:
- setup-build-environment:
name: 'setup-environment-snapshot'
filters:
<<: *master-only
- test:
name: 'snapshot'
requires:
- 'setup-environment-snapshot'
filters:
<<: *master-only
- deploy:
name: 'deploy snapshot'
requires:
- 'snapshot'
context: Sonatype
filters:
<<: *master-only

release:
jobs:
- setup-build-environment:
name: 'setup-environment-release'
filters:
<<: *tags-only
- deploy:
name: 'release to maven central'
requires:
- 'setup-environment-release'
context: Sonatype
filters:
<<: *tags-only
38 changes: 38 additions & 0 deletions .circleci/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--

Copyright 2012-2019 The Feign Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.

-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USER}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
53 changes: 53 additions & 0 deletions .circleci/toolchains.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--

Copyright 2012-2019 The Feign Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.

-->
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>/home/circleci/.sdkman/candidates/java/8.0.382-tem</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
</provides>
<configuration>
<jdkHome>/home/circleci/.sdkman/candidates/java/11.0.22-tem</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>/home/circleci/.sdkman/candidates/java/17.0.10-tem</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>21</version>
</provides>
<configuration>
<jdkHome>/home/circleci/.sdkman/candidates/java/21.0.2-tem</jdkHome>
</configuration>
</toolchain>
</toolchains>
Loading
Loading