From 267c65094d0a77f4519130eb9ef3e51dc5bd5d4f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 27 Mar 2024 14:04:46 +0000 Subject: [PATCH 1/3] Verify snapshots once they have been deployed Closes gh-40119 --- .../workflows/build-and-deploy-snapshot.yml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/build-and-deploy-snapshot.yml b/.github/workflows/build-and-deploy-snapshot.yml index af5bf895a9c..6ad3ac02e02 100644 --- a/.github/workflows/build-and-deploy-snapshot.yml +++ b/.github/workflows/build-and-deploy-snapshot.yml @@ -59,3 +59,54 @@ jobs: status: ${{ job.status }} build-scan-url: ${{ steps.build.outputs.build-scan-url }} run-name: ${{ format('{0} | Linux | Java 17', github.ref_name) }} + - name: Read version from gradle.properties + id: read-version + shell: bash + run: | + version=$(sed -n 's/version=\(.*\)/\1/p' gradle.properties) + echo "Version is $version" + echo "version=$version" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.read-version.outputs.version }} + run-verification-tests: + name: Verify ${{ needs.build-and-deploy-snapshot.outputs.version }} + runs-on: ubuntu-latest + needs: build-and-deploy-snapshot + steps: + - name: Check out release verification tests + uses: actions/checkout@v4 + with: + repository: spring-projects/spring-boot-release-verification + ref: 'main' + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: 'liberica' + java-version: 17 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 + with: + cache-read-only: false + - name: Configure Gradle properties + shell: bash + run: | + mkdir -p $HOME/.gradle + echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties + - name: Run release verification tests + env: + RVT_VERSION: ${{ needs.build-and-deploy-snapshot.outputs.version }} + RVT_RELEASE_TYPE: oss + run: ./gradlew spring-boot-release-verification-tests:test + - name: Upload build reports on failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: build-reports + path: '**/build/reports/' + - name: Send notification + uses: ./.github/actions/send-notification + if: always() + with: + webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }} + status: ${{ job.status }} + run-name: ${{ format('{0} | Verification | {1}', github.ref_name, needs.build-and-deploy-snapshot.outputs.version) }} From 5cc45a6873c49d6780ea4851528c652438bb726c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 27 Mar 2024 14:16:45 +0000 Subject: [PATCH 2/3] Provide a token when checking out verification tests See gh-40119 --- .github/workflows/build-and-deploy-snapshot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-deploy-snapshot.yml b/.github/workflows/build-and-deploy-snapshot.yml index 6ad3ac02e02..3e044812a2e 100644 --- a/.github/workflows/build-and-deploy-snapshot.yml +++ b/.github/workflows/build-and-deploy-snapshot.yml @@ -78,6 +78,7 @@ jobs: with: repository: spring-projects/spring-boot-release-verification ref: 'main' + token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} - name: Set up Java uses: actions/setup-java@v4 with: From 14fef8c100ed518b30050ee4f761dbc52ef79f17 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 27 Mar 2024 14:33:52 +0000 Subject: [PATCH 3/3] Make send notification action available to verify job --- .github/workflows/build-and-deploy-snapshot.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy-snapshot.yml b/.github/workflows/build-and-deploy-snapshot.yml index 3e044812a2e..0e9d0aaa855 100644 --- a/.github/workflows/build-and-deploy-snapshot.yml +++ b/.github/workflows/build-and-deploy-snapshot.yml @@ -79,6 +79,11 @@ jobs: repository: spring-projects/spring-boot-release-verification ref: 'main' token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} + - name: Check out send notification action + uses: actions/checkout@v4 + with: + path: spring-boot + sparse-checkout: .github/actions/send-notification - name: Set up Java uses: actions/setup-java@v4 with: @@ -105,7 +110,7 @@ jobs: name: build-reports path: '**/build/reports/' - name: Send notification - uses: ./.github/actions/send-notification + uses: ./spring-boot/.github/actions/send-notification if: always() with: webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}