Signed-off-by: jongwooo jongwooo.han@gmail.com
Description
Updated workflow to apply dependency caching.
About caching workflow dependencies
Jobs on GitHub-hosted runners start in a clean virtual environment and must download dependencies each time, causing increased network utilization, longer runtime, and increased cost. To help speed up the time it takes to recreate files like dependencies, GitHub can cache files that frequently use in workflows.
Solutions
Java projects can run faster on GitHub Actions by enabling dependency caching on the setup-java action. setup-java
supports caching for both Gradle and Maven projects.
The following example enables caching for a Java project with Gradle:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- run: ./gradlew build
It’s literally a one line change to pass the
cache: 'gradle'
input parameter.
References
- actions/setup-java#caching-packages-dependencies
- How to build Gradle projects with GitHub Actions
- Caching dependencies to speed up workflows | thearchivelog.dev
Comment From: bclozel
Thanks but this action doesn't run Gradle at all so caching is not useful here.