Skip to content

Commit

Permalink
Cleaned up CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Jul 14, 2024
1 parent dc1a3de commit 927a480
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 40 deletions.
58 changes: 34 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
version: 2
version: 2.1

orbs:
sdkman: joshdholtz/[email protected]

defaults: &defaults
working_directory: ~/repo
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
CI_NAME: "CircleCI"

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"
sdk install kotlin 2.0.0
- run:
name: Download the bld dependencies
command: ./bld download
- run:
name: Compile source with bld
command: ./bld compile
- run:
name: Run tests with bld
command: ./bld test
commands:
build_and_test:
parameters:
reports-dir:
type: string
default: "build/reports/test_results"
steps:
- checkout
- sdkman/setup-sdkman
- sdkman/sdkman-install:
candidate: kotlin
version: 2.0.0
- run:
name: Download dependencies
command: ./bld download
- run:
name: Compile source
command: ./bld compile
- run:
name: Run tests
command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
- store_test_results:
path: << parameters.reports-dir >>
- store_artifacts:
path: build/reports/jacoco/test/html

jobs:
bld_jdk17:
Expand All @@ -34,18 +43,19 @@ jobs:
docker:
- image: cimg/openjdk:17.0

<<: *defaults_bld
steps:
- build_and_test

bld_jdk20:
<<: *defaults

docker:
- image: cimg/openjdk:20.0

<<: *defaults_bld
steps:
- build_and_test

workflows:
version: 2
bld:
jobs:
- bld_jdk17
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/bld.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
name: bld-ci

on: [push, pull_request, workflow_dispatch]
on: [ push, pull_request, workflow_dispatch ]

jobs:
build-bld-project:
runs-on: ubuntu-latest

env:
COVERAGE_SDK: "17"
COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.0.0"
KOTLIN_HOME: /usr/share/kotlinc

strategy:
matrix:
java-version: [17, 21, 22]
kotlin-version: [1.9.24, 2.0.0]
java-version: [ 17, 21, 22 ]
kotlin-version: [ 1.9.24, 2.0.0 ]

steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK ${{ matrix.java-version }}
- name: Set up JDK ${{ matrix.java-version }} with Kotlin ${{ matrix.kotlin-version }}
uses: actions/setup-java@v4
with:
distribution: "zulu"
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:

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

variables:
CI_NAME: "GitLab CI"
Expand All @@ -7,13 +7,13 @@ stages:
- test

before_script:
- apt-get update -qq && apt-get install -y curl zip
- dnf -qy update && dnf -y install 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
- sdk install java
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"

test:
Expand Down
4 changes: 2 additions & 2 deletions .idea/libraries/bld.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ pipelines:
- step:
name: Test with bld
script:
# Install Java & Kotlin via SDKMAN!
# Install latest 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
- sdk install java
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
# Download, compile and test with bld
- ./bld download
Expand Down
Binary file modified lib/bld/bld-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/bld/bld-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.6
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=1.9.1
bld.version=2.0.0-SNAPSHOT

0 comments on commit 927a480

Please sign in to comment.