Skip to content
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

Add matrix build of JDK versions #658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
33 changes: 27 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
version: 2
---
version: 2.1
jobs:
build:
working_directory: ~/circleci-java
docker:
- image: circleci/openjdk:8-jdk-stretch
- image: cimg/openjdk:<< parameters.jdk_version >>
parameters:
jdk_version:
type: string
steps:
- checkout
- restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}-<< parameters.jdk_version >>
- run: mvn dependency:go-offline # gets the project dependencies
- save_cache:
paths:
- ~/.m2
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}-<< parameters.jdk_version >>
- run: mvn package
orbs:
prometheus: prometheus/[email protected]
workflows:
version: 2
client_java:
jobs:
- build:
matrix:
parameters:
jdk_version:
- '8.0'
- '11.0'
# TODO: Not working yet.
# - '12.0'
# - '13.0'
# - '14.0'
# - '15.0'
# - '16.0'
filters:
tags:
only: /.*/