Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable Gradle build cache #1093

Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: |
build/
build
key: build-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}

- name: Cache generated Java clients
Expand All @@ -85,12 +85,12 @@ jobs:
src/generated/java
key: generated-java-clients-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}

- name: Cache Maven build artefacts
- name: Cache built ZAR JAR
uses: actions/cache/save@v4
with:
path: |
target/
key: maven-build-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}
target/zaakafhandelcomponent.jar
key: zac-jar-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}

run-unit-tests:
needs: [build]
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
build/
build
key: build-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}

- name: Run unit tests
Expand All @@ -138,7 +138,7 @@ jobs:
src/main/app/reports/*.xml

- name: Generate unit test code coverage report
run: ./gradlew -x compileJava -x processResources -x compileKotlin -x classes -x test -x itest npmRunTestCoverage jacocoTestReport --info
run: ./gradlew -x compileJava -x processResources -x compileKotlin -x classes -x test -x itest -x npmRunBuild npmRunTestCoverage jacocoTestReport --info

- name: Upload unit test coverage report to Codecov
uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -184,8 +184,8 @@ jobs:
uses: actions/cache/restore@v4
with:
path: |
target/
key: maven-build-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}
target/zaakafhandelcomponent.jar
key: zac-jar-${{ github.repository }}-${{ github.ref_name }}-${{ github.run_number }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
9 changes: 3 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ tasks.war {
dependsOn("npmRunBuild")

// add built frontend resources to WAR archive
from("src/main/app/dist/zaakafhandelcomponent")
from("src/main/app/dist")

// explicitly add our 'warLib' 'transitive' dependencies that are required in the generated WAR
classpath(files(configurations["warLib"]))
Expand Down Expand Up @@ -587,9 +587,8 @@ tasks {
// see: https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/faq.md
inputs.files(fileTree("src/main/app/node_modules"))
inputs.files(fileTree("src/main/app/src"))
inputs.file("src/main/app/package.json")
inputs.file("src/main/app/package-lock.json")
outputs.dir("src/main/app/dist/zaakafhandelcomponent")
outputs.dir("src/main/app/dist")
outputs.cacheIf { true }
}

register<NpmTask>("npmRunTest") {
Expand All @@ -600,8 +599,6 @@ tasks {
// see: https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/faq.md
inputs.files(fileTree("src/main/app/node_modules"))
inputs.files(fileTree("src/main/app/src"))
inputs.file("src/main/app/package.json")
inputs.file("src/main/app/package-lock.json")

// directory used by the Jest reporter(s) that we have configured
outputs.dir("src/main/app/reports")
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#

org.gradle.jvmargs=-Xmx2048m
org.gradle.caching=true


Loading