Skip to content

Commit

Permalink
build: cache Gradle deps and build-cache elements in CI (#112)
Browse files Browse the repository at this point in the history
Also includes:
* build: improve performance
* chore: move kotlin source
  • Loading branch information
tim-sh authored Jan 16, 2025
1 parent ca323ca commit 6db55c7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/actions/gradle-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ runs:
distribution: zulu
java-version: 21

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
/root/.gradle/caches/modules-2
/root/.gradle/caches/build-cache-1
/root/.gradle/wrapper
!~/.gradle/caches/modules-2/files-*
key: ${{ runner.os }}-gradle-${{ hashFiles('build.gradle', 'gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test
if: ${{ contains(inputs.steps, 'test') }}
shell: bash
run: |
./gradlew test --info
./gradlew test --info --no-daemon
- name: Upload test results
uses: actions/upload-artifact@v4
Expand All @@ -46,11 +59,11 @@ runs:
if: ${{ contains(inputs.steps, 'build') }}
shell: bash
run: |
./gradlew verifyPlugin buildPlugin
./gradlew verifyPlugin buildPlugin --no-daemon
ls -la build/distributions
- name: Publish
if: ${{ contains(inputs.steps, 'publish') }}
shell: bash
run: |
./gradlew publishPlugin --info
./gradlew publishPlugin --info --no-daemon
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ java {
}
}

sourceSets {
main {
java.srcDirs("src/main/java", "src/main/kotlin")
}
}

intellijPlatform {
buildSearchableOptions = false
autoReload = /* set to true to enable plugin reload on FS changes inside plugin */ false
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ org.gradle.configuration-cache = true
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true

org.gradle.jvmargs=-Xmx2g
org.jetbrains.intellij.platform.useCacheRedirector=true

javaVersion = 21

0 comments on commit 6db55c7

Please sign in to comment.