From 569cc05d5c53ae460135f14ab1e4a46694ecd3ce Mon Sep 17 00:00:00 2001 From: Stanislav Melnichuk Date: Fri, 9 Jun 2023 13:22:06 +0300 Subject: [PATCH] Change location for cache action. --- .../java-pull-request-check-template.yml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/java-pull-request-check-template.yml b/.gitea/workflows/java-pull-request-check-template.yml index b4ca4c5..e3b7024 100644 --- a/.gitea/workflows/java-pull-request-check-template.yml +++ b/.gitea/workflows/java-pull-request-check-template.yml @@ -47,7 +47,7 @@ jobs: cache-read-only: ${{ gitea.ref != 'refs/heads/master' && gitea.ref != 'refs/heads/develop' }} - name: run gradle check - run: ./gradlew ${{ inputs.gradle_check_command }} -i -s + run: ./gradlew ${{ inputs.gradle_check_command }} - id: import-secrets if: ${{ inputs.sonar_enabled }} @@ -60,22 +60,22 @@ jobs: secrets: | ${{ inputs.vault_secrets_base_path }} sonarqube_token | SONAR_TOKEN ; - - name: Cache sonar modules - id: cache-sonar - uses: actions/cache@v3 - env: - cache-name: cache-sonar-modules + - name: calc sonar cache key + if: ${{ inputs.sonar_enabled }} + run: echo "SONAR_SETTINGS_HASH=$(sha1sum ${{ github.workspace }}/build.gradle)" >> "$GITHUB_ENV" + - id: cache-sonar + if: ${{ inputs.sonar_enabled }} + uses: https://github.com/actions/cache@v3 with: - path: /root/.sonar/cache - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle','**/settings.gradle') }} + path: ~/.sonar/cache + key: cache-sonar-modules-${{ env.SONAR_SETTINGS_HASH }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + cache-sonar-modules-${{ env.SONAR_SETTINGS_HASH }} + cache-sonar-modules- - name: run gradle sonar scan if: ${{ inputs.sonar_enabled }} - run: ./gradlew sonar -i -s + run: ./gradlew sonar - name: dockerfile lint check uses: https://github.com/hadolint/hadolint-action@v3.1.0