Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions .github/workflows/build-and-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: echo "The selected java versions are ${{ steps.set-matrix.outputs.version_matrix }}"
outputs:
version_matrix: ${{ steps.set-matrix.outputs.version_matrix }}
build:
test-jvm:
needs: build-jvm-matrix
strategy:
fail-fast: false
Expand All @@ -49,7 +49,9 @@ jobs:
- name: set up JDK
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: ${{ matrix.java_version }}
java-version: |
${{ matrix.java_version }}
21
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already in the matrix? Do we need to add it again manually? Just trying to understand

Copy link
Collaborator Author

@wakingrufus wakingrufus Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the daemon toolchain is locked to 21 now, so we always need 21 for gradle itself. the test process is forked off of that using a project toolchain launcher, determined by the parameter we pass in (which is sourced from the matrix)

distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
Expand All @@ -66,7 +68,7 @@ jobs:
${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }}-
${{ runner.os }}-gradle-wrapper-
- name: Test Plugin
run: ./plugin/gradlew -p ./plugin check --no-daemon
run: ./plugin/gradlew -p ./plugin test${{ matrix.java_version }} --no-daemon
- name: Upload test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
Expand All @@ -83,6 +85,45 @@ jobs:
replay_pid*
plugin/hs_err_pid*
plugin/replay_pid*

build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: set up JDK
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: 21
cache: 'gradle'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
with:
cache-overwrite-existing: true
- name: Restore TestKit cache
# Inspired by https://github.com/actions/cache/issues/432#issuecomment-740376179
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
plugin/.gradle-test-kit/caches/modules-2
plugin/.gradle-test-kit/caches/files-2.1
plugin/.gradle-test-kit/caches/metadata-2.96
key: gradle-wrapper-${{ hashFiles('**/gradlew') }}-${{ github.sha }}
restore-keys: |
gradle-wrapper-${{ hashFiles('**/gradlew') }}-
gradle-wrapper-
Comment on lines +107 to +118
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this get dropped during some of my refactors accidentally? Whoops 😬

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this is copy-pasted from another spot, b/c i had to make a separate task

- name: Check Plugin
run: ./plugin/gradlew -p ./plugin build --no-daemon
- name: Upload test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: test-results
path: plugin/build/reports/tests/test/
- name: Check plugin codestyle
run: ./plugin/gradlew -p ./plugin ktlintCheck --no-daemon

Expand Down Expand Up @@ -124,15 +165,15 @@ jobs:
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: set up JDK 11
- name: set up JDK 21
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
java-version: 11
java-version: 21
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
- name: Check ktlint-plugin on samples
run: ./gradlew ktlintCheck --no-daemon
run: ./gradlew ktlintCheck --no-daemon --stacktrace
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Update build to work with gradle 9.1 and Java 25 [#962](https://github.com/JLLeitschuh/ktlint-gradle/pull/962)
- Collapse sourcesets to simply build [#964](https://github.com/JLLeitschuh/ktlint-gradle/pull/964)

## [13.1.0] - 2025-08-21
Expand Down
1 change: 1 addition & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toolchainVersion=21
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading