From 2fe595dc9bf80fb58cea0bf16fa71f9a87ad30e8 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 20 Dec 2024 11:56:18 +0100 Subject: [PATCH] Update GitHub Actions - Wrapper validation is done as part of setup-gradle, no need to do it ourselves, see https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation - Enable storing configuration cache accross builds - Submit dependencies from gradle to GitHub - Do not inspect all tasks on initialization (no longer needed as we have proper configuration cache) --- .github/workflows/build.yml | 9 +++--- .github/workflows/dependency-submission.yml | 31 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/dependency-submission.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 963c9923a6..50246b91bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,13 @@ jobs: with: distribution: "temurin" java-version: "17" - - name: "Gradle Wrapper validation" - uses: gradle/actions/wrapper-validation@v4 - name: "Setup Gradle" uses: gradle/actions/setup-gradle@v4 + with: + cache-encryption-key: ${{ secrets.GradleEncryptionKey }} + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" - name: "Setup matchers" run: | # Setting up matchers... @@ -43,8 +46,6 @@ jobs: echo "Matcher configured: ${NAME:?}" fi done - - name: "Inspect Gradle tasks" - run: "./gradlew tasks" - name: "Execute Gradle assemble" run: "./gradlew assemble" - name: "Execute Gradle check" diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml new file mode 100644 index 0000000000..e914528a88 --- /dev/null +++ b/.github/workflows/dependency-submission.yml @@ -0,0 +1,31 @@ +name: Dependency Submission +permissions: + contents: write +on: + push: + branches: [ 'master' ] + +jobs: + dependency-submission: + runs-on: ubuntu-latest + env: + GRADLE_MICROG_VERSION_WITHOUT_GIT: 1 + + steps: + - name: "Checkout sources" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "Setup Java" + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + - name: "Generate and submit gradle dependency graph" + uses: gradle/actions/dependency-submission@v4 + with: + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} + dependency-graph-continue-on-failure: true + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes"