From 928bcb256a31154e3a5c2b73b0f42db471e71606 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Thu, 27 Jul 2023 13:08:06 -0500 Subject: [PATCH 1/2] Connect build to ge.spring.io This change publishes a build scan to ge.spring.io for every local build from an authenticated Spring committer and for CI where appropriate access tokens are available. The build will not fail if publishing fails. This change also allows the build to benefit from remote build caching, providing faster builds for all contributors. Additionally, the project will have access to all features of Gradle Enterprise such as: - Dashboards to view all historical build scans, along with performance trends over time - Build failure analytics for enhanced investigation and diagnosis of build failures - Test failure analytics to better understand trends and causes around slow, failing, and flaky tests --- README.adoc | 2 +- settings.gradle | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 98f224a1..a1da61e2 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,6 @@ = Spring Statemachine -image:https://github.com/spring-projects/spring-statemachine/workflows/CI/badge.svg[link="https://github.com/spring-projects/spring-statemachine/actions"] (GitHub default) +image:https://github.com/spring-projects/spring-statemachine/workflows/CI/badge.svg[link="https://github.com/spring-projects/spring-statemachine/actions"] (GitHub default) image:https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Gradle Enterprise", link="https://ge.spring.io/scans?&search.rootProjectNames=spring-statemachine"] The Spring Statemachine project aims to provide a common infrastructure to work with state machine concepts in Spring applications. diff --git a/settings.gradle b/settings.gradle index 17af3dd9..20995406 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,15 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { url 'https://repo.spring.io/release' } + } +} + +plugins { + id 'com.gradle.enterprise' version '3.14.1' + id 'io.spring.ge.conventions' version '0.0.14' +} + rootProject.name = 'spring-statemachine' include 'spring-statemachine-platform' From eed8fece78041fd77d43a7450a268b4dda2f9236 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Thu, 27 Jul 2023 16:28:24 -0500 Subject: [PATCH 2/2] Update workflows with Gradle Enterprise credentials Only workflows that do not build PRs have been configured with credentials. --- .github/workflows/ci-boot.yml | 4 ++++ .github/workflows/ci.yml | 9 ++++++++- .github/workflows/release-ga.yml | 12 ++++++++++++ .github/workflows/release-milestone.yml | 8 ++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-boot.yml b/.github/workflows/ci-boot.yml index ad90dad2..6730e783 100644 --- a/.github/workflows/ci-boot.yml +++ b/.github/workflows/ci-boot.yml @@ -23,6 +23,10 @@ jobs: java-version: ${{ matrix.java }} - name: Build boot ${{ matrix.boot }} java ${{ matrix.java }} run: ./gradlew clean build -PspringBootVersion=${{ matrix.boot }} + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Tar Build Logs if: ${{ failure() }} run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe2c1f5a..e1d2f409 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,10 @@ jobs: java-version: ${{ matrix.java }} - name: Build with Gradle run: ./gradlew clean build + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - name: Tar Build Logs if: ${{ failure() }} run: | @@ -79,7 +83,10 @@ jobs: - name: Build and Publish Snapshot run: | jf gradle clean build -x test artifactoryPublish - + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # publish build info so that we can see it in artifactory "builds" - name: Publish Build Info run: | diff --git a/.github/workflows/release-ga.yml b/.github/workflows/release-ga.yml index 61dc6599..25d01eb3 100644 --- a/.github/workflows/release-ga.yml +++ b/.github/workflows/release-ga.yml @@ -45,6 +45,10 @@ jobs: run: | jf gradle releaseVersion echo PROJECT_VERSION=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}') >> $GITHUB_ENV + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # build and publish to staging repo. # we've allready tested with snapshots so no need to test # with a release build as we are not a release train. @@ -52,6 +56,10 @@ jobs: run: | jf gradle clean build artifactoryPublish jf rt build-publish + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4 @@ -100,6 +108,10 @@ jobs: - name: Switch to Next Dev Version run: | jf gradle nextVersion + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} - uses: jvalkeal/build-zoo-handler@v0.0.4 with: commit-changes-branch: main diff --git a/.github/workflows/release-milestone.yml b/.github/workflows/release-milestone.yml index e9982ddb..56faa44e 100644 --- a/.github/workflows/release-milestone.yml +++ b/.github/workflows/release-milestone.yml @@ -49,6 +49,10 @@ jobs: run: | jf gradle milestoneVersion -PstatemachineMilestone=${{ github.event.inputs.milestone }} echo PROJECT_VERSION=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}') >> $GITHUB_ENV + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # build and publish to staging repo. # we've allready tested with snapshots so no need to test # with a release build as we are not a release train. @@ -56,6 +60,10 @@ jobs: run: | jf gradle clean build artifactoryPublish jf rt build-publish + env: + GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} + GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} # we've now done a release build, branch and tag it in github - name: Tag Release uses: jvalkeal/build-zoo-handler@v0.0.4