From cae6d80f667afead0dc5e3fb4ba593266ed1b331 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Wed, 13 Dec 2023 16:24:50 +0100 Subject: [PATCH] Tune GHA gradle cache Signed-off-by: Fabio Di Fabio --- .github/workflows/checks.yml | 14 ++++++++++---- .github/workflows/codeql.yml | 8 ++++++-- .github/workflows/release.yml | 6 +++++- .github/workflows/sonarcloud.yml | 12 +++++------- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 900cc5c9775..25d941bb171 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -13,11 +13,14 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: 'temurin' java-version: 17 cache: gradle + cache-dependency-path: | + **/version.gradle + **/verification-metadata.xml - name: spotless run: ./gradlew --no-daemon --parallel clean spotlessCheck javadoc_17: @@ -27,10 +30,13 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - name: Set up Java 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: 'temurin' java-version: 17 cache: gradle + cache-dependency-path: | + **/version.gradle + **/verification-metadata.xml - name: javadoc (JDK 17) run: ./gradlew --no-daemon clean javadoc diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f4ecae04ba4..fbe659b0219 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,10 +42,14 @@ jobs: uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: 'temurin' java-version: 17 + cache: gradle + cache-dependency-path: | + **/version.gradle + **/verification-metadata.xml # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2041368b0f..c0542c30f75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,10 +7,14 @@ jobs: runs-on: [besu-research-ubuntu-16] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '17' + cache: gradle + cache-dependency-path: | + **/version.gradle + **/verification-metadata.xml - name: Login to DockerHub run: echo '${{ secrets.DOCKER_PASSWORD_RW }}' | docker login -u '${{ secrets.DOCKER_USER_RW }}' --password-stdin - name: Setup Gradle diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 5a2ba5143ee..f2515df0ab8 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,22 +19,20 @@ jobs: - name: checkout uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' + cache: gradle + cache-dependency-path: | + **/version.gradle + **/verification-metadata.xml - name: Cache SonarCloud packages uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any