Skip to content

Commit 3c44881

Browse files
committed
Add matrix build of JDK versions
Test build on various OpenJDK versions. Signed-off-by: SuperQ <[email protected]>
1 parent 2b60c47 commit 3c44881

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

.circleci/config.yml

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
version: 2
1+
---
2+
version: 2.1
23
jobs:
34
build:
45
working_directory: ~/circleci-java
56
docker:
6-
- image: circleci/openjdk:8-jdk-stretch
7+
- image: cimg/openjdk:<< parameters.jdk_version >>
8+
parameters:
9+
jdk_version:
10+
type: string
711
steps:
812
- checkout
913
- restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed
10-
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}
14+
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}-<< parameters.jdk_version >>
1115
- run: mvn dependency:go-offline # gets the project dependencies
1216
- save_cache:
1317
paths:
1418
- ~/.m2
15-
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}
19+
key: circleci-demo-java-spring-{{ checksum "pom.xml" }}-<< parameters.jdk_version >>
1620
- run: mvn package
17-
orbs:
18-
prometheus: prometheus/[email protected]
21+
workflows:
22+
version: 2
23+
client_java:
24+
jobs:
25+
- build:
26+
matrix:
27+
parameters:
28+
jdk_version:
29+
- '8.0'
30+
- '11.0'
31+
# TODO: Not working yet.
32+
# - '12.0'
33+
# - '13.0'
34+
# - '14.0'
35+
# - '15.0'
36+
# - '16.0'
37+
filters:
38+
tags:
39+
only: /.*/

0 commit comments

Comments
 (0)