15 changed files with 183 additions and 120 deletions
@ -0,0 +1,17 @@ |
|||||||
|
name: Print JVM thread dumps |
||||||
|
description: 'Prints a thread dump for all running JVMs' |
||||||
|
runs: |
||||||
|
using: composite |
||||||
|
steps: |
||||||
|
- if: ${{ runner.os == 'Linux' }} |
||||||
|
shell: bash |
||||||
|
run: | |
||||||
|
for jvm_pid in $(jps -q -J-XX:+PerfDisableSharedMem); do |
||||||
|
jcmd $jvm_pid Thread.print |
||||||
|
done |
||||||
|
- if: ${{ runner.os == 'Windows' }} |
||||||
|
shell: powershell |
||||||
|
run: | |
||||||
|
foreach ($jvm_pid in $(jps -q -J-XX:+PerfDisableSharedMem)) { |
||||||
|
jcmd $jvm_pid Thread.print |
||||||
|
} |
||||||
@ -1,33 +1,39 @@ |
|||||||
name: Send Notification |
name: Send Notification |
||||||
description: Sends a Google Chat message as a notification of the job's outcome |
description: 'Sends a Google Chat message as a notification of the job''s outcome' |
||||||
inputs: |
inputs: |
||||||
webhook-url: |
|
||||||
description: 'Google Chat Webhook URL' |
|
||||||
required: true |
|
||||||
status: |
|
||||||
description: 'Status of the job' |
|
||||||
required: true |
|
||||||
build-scan-url: |
build-scan-url: |
||||||
description: 'URL of the build scan to include in the notification' |
description: 'URL of the build scan to include in the notification' |
||||||
|
required: false |
||||||
run-name: |
run-name: |
||||||
description: 'Name of the run to include in the notification' |
description: 'Name of the run to include in the notification' |
||||||
|
required: false |
||||||
default: ${{ format('{0} {1}', github.ref_name, github.job) }} |
default: ${{ format('{0} {1}', github.ref_name, github.job) }} |
||||||
|
status: |
||||||
|
description: 'Status of the job' |
||||||
|
required: true |
||||||
|
webhook-url: |
||||||
|
description: 'Google Chat Webhook URL' |
||||||
|
required: true |
||||||
runs: |
runs: |
||||||
using: composite |
using: composite |
||||||
steps: |
steps: |
||||||
- shell: bash |
- name: Prepare Variables |
||||||
|
shell: bash |
||||||
run: | |
run: | |
||||||
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV" |
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV" |
||||||
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV" |
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV" |
||||||
- shell: bash |
- name: Success Notification |
||||||
if: ${{ inputs.status == 'success' }} |
if: ${{ inputs.status == 'success' }} |
||||||
|
shell: bash |
||||||
run: | |
run: | |
||||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true |
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true |
||||||
- shell: bash |
- name: Failure Notification |
||||||
if: ${{ inputs.status == 'failure' }} |
if: ${{ inputs.status == 'failure' }} |
||||||
|
shell: bash |
||||||
run: | |
run: | |
||||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true |
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true |
||||||
- shell: bash |
- name: Cancel Notification |
||||||
if: ${{ inputs.status == 'cancelled' }} |
if: ${{ inputs.status == 'cancelled' }} |
||||||
|
shell: bash |
||||||
run: | |
run: | |
||||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true |
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true |
||||||
|
|||||||
@ -0,0 +1,36 @@ |
|||||||
|
name: Build Pull Request |
||||||
|
on: pull_request |
||||||
|
permissions: |
||||||
|
contents: read |
||||||
|
jobs: |
||||||
|
build: |
||||||
|
name: Build Pull Request |
||||||
|
if: ${{ github.repository == 'spring-projects/spring-framework' }} |
||||||
|
runs-on: ubuntu-latest |
||||||
|
timeout-minutes: 60 |
||||||
|
steps: |
||||||
|
- name: Set Up JDK 17 |
||||||
|
uses: actions/setup-java@v4 |
||||||
|
with: |
||||||
|
distribution: 'liberica' |
||||||
|
java-version: '17' |
||||||
|
- name: Check Out |
||||||
|
uses: actions/checkout@v4 |
||||||
|
- name: Validate Gradle Wrapper |
||||||
|
uses: gradle/actions/wrapper-validation@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0 |
||||||
|
- name: Set Up Gradle |
||||||
|
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0 |
||||||
|
- name: Build |
||||||
|
env: |
||||||
|
CI: 'true' |
||||||
|
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io' |
||||||
|
run: ./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --no-parallel --continue build |
||||||
|
- name: Print JVM Thread Dumps When Cancelled |
||||||
|
if: cancelled() |
||||||
|
uses: ./.github/actions/print-jvm-thread-dumps |
||||||
|
- name: Upload Build Reports |
||||||
|
if: failure() |
||||||
|
uses: actions/upload-artifact@v4 |
||||||
|
with: |
||||||
|
name: build-reports |
||||||
|
path: '**/build/reports/' |
||||||
@ -1,11 +0,0 @@ |
|||||||
name: "Validate Gradle Wrapper" |
|
||||||
on: [push, pull_request] |
|
||||||
permissions: |
|
||||||
contents: read |
|
||||||
jobs: |
|
||||||
validation: |
|
||||||
name: "Validate Gradle Wrapper" |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v4 |
|
||||||
- uses: gradle/actions/wrapper-validation@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0 |
|
||||||
Loading…
Reference in new issue