From 6e91a496090e3615d97645e3083db784a50bc537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Thu, 3 Nov 2022 11:46:49 -0600 Subject: [PATCH 1/2] Use `gradle/gradle-build-action` Those are the enefits we can get from the action and our current usage: * Efficient cache * Summary report * Capture of build scan links --- .github/workflows/ci-examples.yml | 16 ++++------------ .github/workflows/ci.yml | 21 ++++++++++----------- .github/workflows/release.yml | 3 +++ 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-examples.yml b/.github/workflows/ci-examples.yml index 26e317b1efa..2ffe0a30eb6 100644 --- a/.github/workflows/ci-examples.yml +++ b/.github/workflows/ci-examples.yml @@ -24,12 +24,8 @@ jobs: with: java-version: '8.0.302' distribution: temurin - - name: Cache Gradle Home files - uses: actions/cache@v3.0.11 - continue-on-error: true - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-home-testmatrix-examples-${{ hashFiles('**/*.gradle') }} + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 - id: set-matrix working-directory: ./examples/ env: @@ -52,14 +48,10 @@ jobs: with: java-version: '8.0.302' distribution: temurin - - name: Cache Gradle Home files - uses: actions/cache@v3.0.11 - continue-on-error: true - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }} - name: Clear existing docker image cache run: docker image prune -af + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 - name: Build and test Examples with Gradle (${{matrix.gradle_args}}) working-directory: ./examples/ run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e926d8f16db..405d2596d08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,8 @@ jobs: with: java-version: '8.0.302' distribution: temurin - - name: Cache Gradle Home files - uses: actions/cache@v3.0.11 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-home-testmatrix-${{ hashFiles('**/*.gradle') }} + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 - id: set-matrix env: # Since we override the tests executor, @@ -50,14 +47,16 @@ jobs: with: java-version: '8.0.302' distribution: temurin - - name: Cache Gradle Home files - uses: actions/cache@v3.0.11 - continue-on-error: true - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }} - name: Clear existing docker image cache run: docker image prune -af + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-includes: | + caches + notifications + jdks + gradle-home-cache-cleanup: true - name: Build and test with Gradle (${{matrix.gradle_args}}) run: | ./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29a0b920922..c6fa99f2477 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,9 @@ jobs: - name: Clear existing docker image cache run: docker image prune -af + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 + - name: Run Gradle Build run: ./gradlew build --scan --no-daemon -i -x test From 1c6a958ca8cd225ac9140a1c658508761fdf06e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Thu, 3 Nov 2022 12:08:25 -0600 Subject: [PATCH 2/2] Add missing config --- .github/workflows/ci-examples.yml | 2 ++ .github/workflows/ci-rootless.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci-examples.yml b/.github/workflows/ci-examples.yml index 2ffe0a30eb6..6a1df55adbc 100644 --- a/.github/workflows/ci-examples.yml +++ b/.github/workflows/ci-examples.yml @@ -52,6 +52,8 @@ jobs: run: docker image prune -af - name: Setup Gradle Build Action uses: gradle/gradle-build-action@v2 + with: + gradle-home-cache-cleanup: true - name: Build and test Examples with Gradle (${{matrix.gradle_args}}) working-directory: ./examples/ run: | diff --git a/.github/workflows/ci-rootless.yml b/.github/workflows/ci-rootless.yml index 50db1655a4a..b04ec9a7429 100644 --- a/.github/workflows/ci-rootless.yml +++ b/.github/workflows/ci-rootless.yml @@ -33,5 +33,7 @@ jobs: PATH=$HOME/bin:$PATH dockerd-rootless.sh --experimental --storage-driver vfs & sleep 1 DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock docker info || ls -la $XDG_RUNTIME_DIR + - name: Setup Gradle Build Action + uses: gradle/gradle-build-action@v2 - name: Build with Gradle run: ./gradlew --no-daemon --scan testcontainers:test --tests '*GenericContainerRuleTest'