From d2c0e12e1a88de4a1adf9de150a0668ced4e31b8 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 19 May 2021 20:18:32 -0700 Subject: [PATCH] Added Gradle caches setup and cleanup. --- .github/workflows/gradle.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b1bb3a7..b11bffb 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,11 +22,14 @@ jobs: key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Gradle packages - uses: actions/cache@v1 + uses: actions/cache@v2 with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Test with Gradle env: CI_NAME: "GitHub CI" @@ -43,3 +46,7 @@ jobs: TWITTER_TOKEN: ${{ secrets.TWITTER_TOKEN }} TWITTER_TOKENSECRET: ${{ secrets.TWITTER_TOKENSECRET }} run: ./gradlew check sonarqube + - name: Cleanup Gradle Cache + run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties