From 215831809a72250954037c984978c316a0e27d9a Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sun, 2 May 2021 14:30:46 +0200 Subject: [PATCH] Add matrix build of JDK versions Test build on various OpenJDK versions. Signed-off-by: SuperQ --- .circleci/config.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96bd70d06..470448ec4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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/prometheus@0.11.0 +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: /.*/