From 0ee28f822b98b8c1549902e180d97c101bdba2be Mon Sep 17 00:00:00 2001 From: Carlos Roman Date: Thu, 28 Dec 2023 12:00:11 +0000 Subject: [PATCH] Adding Maven cache to CircleCI config --- .circleci/config.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dac557df..4495d2ed9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,12 +2,37 @@ version: 2 lint_steps: &lint_steps steps: - checkout + - restore_cache: + name: Restore Maven cache + keys: + # when pom.xml file changes, use increasingly general patterns to restore cache + # Linting has own cache as deps not downloaded during test phases. If doesn't exist will + # fall back on any available cache. + - &maven-cache maven-cache-{{ .Branch }}-{{ checksum "pom.xml" }}-lint + - maven-cache-{{ .Branch }}- + - maven-cache- - run: ./mvnw verify -B -Dhttps.protocols=TLSv1.2 -DskipTests + - save_cache: + key: *maven-cache + paths: + - ~/.m2 build_steps: &build_steps steps: - checkout + - restore_cache: + name: Restore Maven cache + keys: + # when pom.xml file changes, use increasingly general patterns to restore cache + - &maven-cache maven-cache-{{ .Branch }}-{{ checksum "pom.xml" }} + - maven-cache-{{ .Branch }}- + - maven-cache- - setup_remote_docker - run: ./mvnw test -B -Dhttps.protocols=TLSv1.2 -Dcheckstyle.skip=true -Dtests.log_level=info -Djdk.attach.allowAttachSelf=true + - save_cache: + when: always + key: *maven-cache + paths: + - ~/.m2 - run: when: on_fail command: for log in target/surefire-reports/*.txt; do echo "$log ========================" ; cat $log ; done