diff --git a/.circleci/config.yml b/.circleci/config.yml index 77889be..c781fdc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,8 @@ -version: 2 +version: 2.1 + +orbs: + sdkman: joshdholtz/sdkman@0.2.0 + defaults: &defaults working_directory: ~/repo environment: @@ -6,18 +10,31 @@ defaults: &defaults TERM: dumb CI_NAME: "CircleCI" -defaults_gradle: &defaults_bld - steps: - - checkout - - 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.1.10 + - 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: @@ -26,19 +43,20 @@ jobs: docker: - image: cimg/openjdk:17.0 - <<: *defaults_bld + steps: + - build_and_test - bld_jdk20: + bld_jdk21: <<: *defaults docker: - - image: cimg/openjdk:20.0 + - image: cimg/openjdk:21.0 - <<: *defaults_bld + steps: + - build_and_test workflows: - version: 2 bld: jobs: - bld_jdk17 - - bld_jdk20 + - bld_jdk21 diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index ba51eb1..2f03292 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -2,48 +2,67 @@ name: bld-ci on: [ push, pull_request, workflow_dispatch ] +env: + COVERAGE_JDK: "21" + COVERAGE_KOTLIN: "2.1.20" + jobs: build-bld-project: - runs-on: ubuntu-latest - - env: - COVERAGE_SDK: "17" - strategy: matrix: - java-version: [ 17, 20 ] + java-version: [ 17, 21, 24 ] + kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ] + os: [ ubuntu-latest, windows-latest, macos-latest ] + + runs-on: ${{ matrix.os }} steps: - name: Checkout source repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + - name: Set up JDK ${{ matrix.java-version }} with Kotlin ${{ matrix.kotlin-version }} + uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: "zulu" java-version: ${{ matrix.java-version }} - - name: Grant bld execute permission - run: chmod +x bld - - - name: Download the bld dependencies + - name: Download dependencies [bld example] + working-directory: examples/bld run: ./bld download - - name: Compile source with bld + - name: Compile and run examples [bld example] + working-directory: examples/bld + run: | + ./bld compile + ./bld run + ./bld run-java + + - name: Run examples [gradle example] + working-directory: examples/gradle + run: | + ./gradlew run + ./gradlew runJava + + - name: Download dependencies + run: ./bld download + + - name: Compile source run: ./bld compile - - name: Run tests with bld + - name: Run tests run: ./bld jacoco - name: Remove pom.xml - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN + && matrix.os == 'ubuntu-latest' run: rm -rf pom.xml - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master - if: success() && matrix.java-version == env.COVERAGE_SDK + if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN + && matrix.os == 'ubuntu-latest' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.gitignore b/.gitignore index 9c35a25..ea86fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,4 +54,4 @@ atlassian-ide-plugin.xml # Editor-based Rest Client .idea/httpRequests -local.properties \ No newline at end of file +local.properties diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 052df48..10b9b0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,24 @@ -image: openjdk:17 +image: fedora:latest + +variables: + CI_NAME: "GitLab CI" stages: - test +before_script: + - 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 + - sdk install kotlin + - 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/.idea/app.iml b/.idea/app.iml index 2c1fe21..9e43636 100644 --- a/.idea/app.iml +++ b/.idea/app.iml @@ -11,6 +11,8 @@ + + diff --git a/.idea/bld.xml b/.idea/bld.xml new file mode 100644 index 0000000..6600cee --- /dev/null +++ b/.idea/bld.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 562d6ca..6b3d5a0 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -32,12 +32,49 @@