From 543bf3d0840b15eabc22d3cb56859365d62f4654 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 12 Jul 2024 17:43:29 -0700 Subject: [PATCH] Install Kotlin via SDKMAN! in CI workflows --- .circleci/config.yml | 10 ++++++++++ .gitlab-ci.yml | 18 ++++++++++++++---- bitbucket-pipelines.yml | 10 +++++++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 09d88965..e0b480cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,16 @@ defaults: &defaults defaults_bld: &defaults_bld steps: - checkout + - run: + name: Install Kotlin via SDKMAN! + command: | + curl -s "https://get.sdkman.io" | bash + echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + source "$HOME/.sdkman/bin/sdkman-init.sh" + echo 'export SDKMAN_DIR="$HOME/.sdkman"' >> $BASH_ENV + echo 'source "$HOME/.sdkman/bin/sdkman-init.sh"' >> $BASH_ENV + sdk install kotlin 2.0.0 - run: name: Download the bld dependencies command: ./bld download diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2398bba5..14646f3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: openjdk:17 +image: ubuntu:latest variables: CI_NAME: "GitLab CI" @@ -6,9 +6,19 @@ variables: stages: - test +before_script: + - apt-get update -qq && apt-get install -y curl zip + - curl -s "https://get.sdkman.io" | bash + - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + - source "$HOME/.sdkman/bin/sdkman-init.sh" + - sdk install java 17.0.11-tem + - sdk install kotlin 2.0.0 + - source "$HOME/.sdkman/bin/sdkman-init.sh" + test: stage: test script: - - ./bld download - - ./bld compile - - ./bld test + - ./bld download + - ./bld compile + - ./bld test diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 7c851945..f191a728 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,10 +1,18 @@ -image: openjdk:17 +image: ubuntu:latest pipelines: default: - step: name: Test with bld script: + - apt-get update -qq && apt-get install -y curl zip + - curl -s "https://get.sdkman.io" | bash + - echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config + - echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config + - source "$HOME/.sdkman/bin/sdkman-init.sh" + - sdk install java 17.0.11-tem + - sdk install kotlin 2.0.0 + - source "$HOME/.sdkman/bin/sdkman-init.sh" - ./bld download - ./bld compile - ./bld test