Skip to content

Commit

Permalink
Install Kotlin via SDKMAN! in CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Jul 13, 2024
1 parent b989f6f commit c1fdcd0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/bld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
java-version: [17, 21, 22]
kotlin-version: [ 1.9.24, 2.0.0 ]
kotlin-version: [1.9.24, 2.0.0]

steps:
- name: Checkout source repository
Expand Down Expand Up @@ -49,13 +49,10 @@ jobs:
EXCHANGERATE_API_KEY: ${{ secrets.EXCHANGERATE_API_KEY }}
run: ./bld jacoco

- name: Remove pom.xml
- name: SonarCloud Scan
if: success() && matrix.java-version == env.COVERAGE_SDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
run: rm -rf pom.xml

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: success() && matrix.java-version == env.COVERAGE_SDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
18 changes: 14 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
image: openjdk:17
image: ubuntu:latest

variables:
CI_NAME: "GitLab CI"

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
12 changes: 11 additions & 1 deletion bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
image: openjdk:17
image: ubuntu:latest

pipelines:
default:
- step:
name: Test with bld
script:
# Install Java & Kotlin via SDKMAN!
- 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"
# Download, compile and test with bld
- ./bld download
- ./bld compile
- ./bld test

0 comments on commit c1fdcd0

Please sign in to comment.