From 6f4d9562ee0fc87685388ab10452413e9ea61777 Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Sat, 18 Nov 2023 18:44:03 +0100 Subject: [PATCH] fix: cache sdkman to avoid all the temp unavailable errors --- .circleci/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 753fe1a..4709488 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,13 +75,25 @@ commands: install_sdkman: description: Install SDKMAN steps: + - restore_cache: + name: Restore SDKMan executable + keys: + - sdkman-cli-{{ arch }}-v1 - run: name: Installing SDKMAN command: | - curl -s "https://get.sdkman.io?rcupdate=false" | bash + if ! command -v sdk &> /dev/null + then + curl -s "https://get.sdkman.io?rcupdate=false" | bash + fi + echo -e '\nsource "/home/circleci/.sdkman/bin/sdkman-init.sh"' >> $BASH_ENV source $BASH_ENV sdk list java + - save_cache: + key: sdkman-cli-{{ arch }}-v1 + paths: + - ~/.sdkman install_gradle_unix: description: Install gradle parameters: