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
34 changes: 28 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,27 @@ jobs:
# on 2026-10-19). Only builds of the default branch write the cache; pull requests read it. Two
# things stay out: the local build cache, left out on purpose for now, and the IDE the IntelliJ
# plugin's tests start, whose 852 MB zip and the 2.1 GB it unpacks to under transforms would take
# longer to restore than to download and fill much of the repository's 10 GB. Leaving paths out is a
# feature of the default, proprietary cache provider, bundled in the action and free for public
# repositories; the open-source one has none.
# longer to restore than to download and fill much of the repository's 10 GB. One thing goes in besides
# the default `caches` and `notifications`: the downloads of the Gradle plugins' TestKit builds, the
# Android Gradle plugin and its dependencies above all. Those builds have a Gradle user home of their
# own, under build/tmp by default, which the cache did not reach: every job downloaded it all from
# Maven Central again, until Maven Central answered 429 Too Many Requests on 2026-11-28. -PtestkitDir
# puts that home at test-kit in this one. Choosing paths is a feature of the default, proprietary
# cache provider, bundled in the action and free for public repositories; the open-source one has none.
- name: Cache Gradle's downloads
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
with:
gradle-home-cache-includes: |
caches
notifications
test-kit/caches/modules-2
gradle-home-cache-excludes: |
caches/build-cache-1
caches/modules-2/files-2.1/com.jetbrains.intellij.idea
caches/*/transforms

- name: Build
run: ./gradlew check
run: ./gradlew check -PtestkitDir="$GRADLE_USER_HOME/test-kit"

- name: Publish Test Report
uses: mikepenz/action-junit-report@a16be3a69023e9bd7e748ede768b3282ea7b30ce # v6.7.1
Expand Down Expand Up @@ -125,6 +133,10 @@ jobs:
- name: Cache Gradle's downloads
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
with:
gradle-home-cache-includes: |
caches
notifications
test-kit/caches/modules-2
gradle-home-cache-excludes: |
caches/build-cache-1
caches/modules-2/files-2.1/com.jetbrains.intellij.idea
Expand All @@ -147,7 +159,7 @@ jobs:
TESTKIT_GRADLE: ${{ matrix.gradle }}
run: >-
./gradlew test -PjavaRuntime="${JDK%-ea}" -PtestkitGradleVersion="$TESTKIT_GRADLE" ${{ matrix.gradle_args }}
-Porg.gradle.java.installations.paths="$TEST_JDK"
-Porg.gradle.java.installations.paths="$TEST_JDK" -PtestkitDir="$GRADLE_USER_HOME/test-kit"

- name: Publish Test Report
uses: mikepenz/action-junit-report@a16be3a69023e9bd7e748ede768b3282ea7b30ce # v6.7.1
Expand Down Expand Up @@ -210,6 +222,10 @@ jobs:
- name: Cache Gradle's downloads
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
with:
gradle-home-cache-includes: |
caches
notifications
test-kit/caches/modules-2
gradle-home-cache-excludes: |
caches/build-cache-1
caches/modules-2/files-2.1/com.jetbrains.intellij.idea
Expand Down Expand Up @@ -258,7 +274,9 @@ jobs:
out-dir: ${{ runner.temp }}/deb-package

- name: Test the plugins against the image
run: ./gradlew -PnativeImage=true :open-java-format-jdk-bootstrap:test :gradle-open-java-format:test
run: >-
./gradlew -PnativeImage=true -PtestkitDir="$GRADLE_USER_HOME/test-kit"
:open-java-format-jdk-bootstrap:test :gradle-open-java-format:test
env:
JDK21_HOME: ${{ steps.jdk21.outputs.path }}

Expand Down Expand Up @@ -325,6 +343,10 @@ jobs:
- name: Cache Gradle's downloads
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
with:
gradle-home-cache-includes: |
caches
notifications
test-kit/caches/modules-2
gradle-home-cache-excludes: |
caches/build-cache-1
caches/modules-2/files-2.1/com.jetbrains.intellij.idea
Expand Down
9 changes: 9 additions & 0 deletions gradle-open-java-format/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ tasks.named("test").configure {
systemProperty 'testkit.gradleVersion', testkitGradleVersion.get()
}

// The Gradle user home of the TestKit builds, which their downloads go to: the Android Gradle plugin and its
// dependencies above all. TestKit's default is under this task's temporary directory, which CI's cache does not
// reach, so CI passes a directory in the Gradle user home it caches. Locally the default stays: one directory for
// every checkout would be shared by tests that delete from it.
def testkitDir = providers.gradleProperty('testkitDir').filter { !it.isEmpty() }
if (testkitDir.isPresent()) {
systemProperty 'org.gradle.testkit.dir', testkitDir.get()
}

if (rootProject.ext.nativeImageRequested) {
dependsOn(writeNativeImagePath)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,21 @@ void spotlessApply_formats_the_root_project_and_every_subproject_when_the_root_h
void formats_with_a_formatter_dependency_that_has_variants_when_the_root_has_no_java() {
writeLibraryWithVariants();
// idea: updateOpenJavaFormatXml runs with every build and resolves palantirJavaFormat in the root project.
// The library is looked for in its own repository only: without exclusiveContent the root project asked
// Maven Central for it first, and a 429 from Maven Central failed the test.
var project = project()
.plugins("idea")
.buildGradle("""
allprojects {
repositories {
maven { url = file("%s") }
exclusiveContent {
forRepository {
maven { url = file("%s") }
}
filter {
includeGroup 'test'
}
}
}
}
dependencies {
Expand Down
Loading