Since our Dev team agreed to use the GHA caching to fasten their gradle and maven builds
We can use below steps to achieve this.
https://github.com/actions/setup-java#caching-packages-dependencies
For Gradle Cache
we can use marketplace gradle build action
https://github.com/marketplace/actions/gradle-build-action
We can use gradle wrapper action for checksumĀ validation of jars
https://github.com/marketplace/actions/gradle-wrapper-validation
# Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache uses: actions/cache@v2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache uses: actions/cache@v2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
For Maven Cache:
https://github.com/actions/cache/blob/master/examples.md#java---maven
- name: Cache local Maven repository uses: actions/cache@v2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven-