diff --git a/.github/workflows/ci-aarchxx-cross.yml b/.github/workflows/ci-aarchxx-cross.yml index e3a16114d80..5861fc01a5d 100644 --- a/.github/workflows/ci-aarchxx-cross.yml +++ b/.github/workflows/ci-aarchxx-cross.yml @@ -29,6 +29,10 @@ # DAMAGE. # Github Actions workflow for AArchXX Continuous Integration testing. +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-aarchxx-cross on: @@ -98,30 +102,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/aarchxx-cross-compile - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # ARM cross-compile with gcc, with some tests run under QEMU. # We use a more recent Ubuntu for a more recent QEMU. arm-cross-compile: @@ -171,30 +151,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/aarchxx-cross-compile - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # Android ARM cross-compile with gcc, no tests: android-arm-cross-compile: runs-on: ubuntu-20.04 @@ -243,30 +199,6 @@ jobs: CI_BRANCH: ${{ github.ref }} run: ./suite/runsuite_wrapper.pl automated_ci 32_only - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/android-arm-cross-compile - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # Android AArch64 cross-compile with LLVM, no tests: android-aarch64-cross-compile: runs-on: ubuntu-22.04 @@ -309,30 +241,6 @@ jobs: CI_BRANCH: ${{ github.ref }} run: ./suite/runsuite_wrapper.pl automated_ci 64_only - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/android-aarch64-cross-compile - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # AArch64 drdecode and drmemtrace on x86: a64-on-x86: runs-on: ubuntu-20.04 @@ -369,26 +277,19 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [aarch64-cross-compile, arm-cross-compile, android-arm-cross-compile, android-aarch64-cross-compile, a64-on-x86] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/a64-on-x86 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1} | {2} {3} | {4} {5} | {6} {7} | {8} {9}', + 'aarch64-cross-compile', needs.aarch64-cross-compile.result, + 'arm-cross-compile', needs.arm-cross-compile.result, + 'android-arm-cross-compile', needs.android-arm-cross-compile.result, + 'android-aarch64-cross-compile', needs.android-aarch64-cross-compile.result, + 'a64-on-x86', needs.a64-on-x86.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-aarchxx.yml b/.github/workflows/ci-aarchxx.yml index e7d9b60a5fa..40df42daa81 100644 --- a/.github/workflows/ci-aarchxx.yml +++ b/.github/workflows/ci-aarchxx.yml @@ -30,6 +30,10 @@ # DAMAGE. # Github Actions workflow for aarch64 Continuous Integration testing. +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-aarchxx on: @@ -128,26 +132,15 @@ jobs: CI_BRANCH: ${{ github.ref }} if: ${{ matrix.sve == true && matrix.sve_length != ''}} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-32 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [aarch64-precommit] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} + with: + test_suite_status: ${{ format('{0} {1}', + 'aarch64-precommit', needs.aarch64-precommit.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-clang-format.yml b/.github/workflows/ci-clang-format.yml index be618af9093..56a9ae9f9ca 100644 --- a/.github/workflows/ci-clang-format.yml +++ b/.github/workflows/ci-clang-format.yml @@ -29,6 +29,9 @@ # DAMAGE. # Github Actions workflow for clang-format Continuous Integration testing. +# +# When adding a new job, remember to add it to the send-failure-notification +# job to ensure failure notifications are set up properly. name: ci-clang-format on: @@ -87,26 +90,16 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [clang-format] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/clang-format - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1}', + 'clang-format', needs.clang-format.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 488864626f6..5c8ca32c041 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -29,6 +29,9 @@ # DAMAGE. # Github Actions workflow for building doxygen docs for the web site. +# +# When adding a new job, remember to add it to the send-failure-notification +# job to ensure failure notifications are set up properly. name: ci-docs on: @@ -130,26 +133,15 @@ jobs: # We need a personal access token for write access to another repo. GITHUB_TOKEN: ${{ secrets.DOCS_TOKEN }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [docs] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/docs - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs + test_suite_status: ${{ format('{0} {1}', + 'docs', needs.docs.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-osx.yml b/.github/workflows/ci-osx.yml index 26f5a9082b2..f15a37d16a1 100644 --- a/.github/workflows/ci-osx.yml +++ b/.github/workflows/ci-osx.yml @@ -29,6 +29,10 @@ # DAMAGE. # Github Actions workflow for Mac OSX Continuous Integration testing. +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-osx on: @@ -86,26 +90,15 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [osx-x86-64] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/osx-x86-64 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1}', + 'osx-x86-64', needs.osx-x86-64.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-package.yml b/.github/workflows/ci-package.yml index 43a6b7bf788..49d29345243 100644 --- a/.github/workflows/ci-package.yml +++ b/.github/workflows/ci-package.yml @@ -29,6 +29,10 @@ # DAMAGE. # Github Actions workflow for release packages. +# +# Each package build is a separate job. When adding a new package build job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-package on: @@ -133,30 +137,6 @@ jobs: name: linux-tarball path: DynamoRIO-Linux-${{ steps.version.outputs.version_number }}.tar.gz - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/linux-x86 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs - ########################################################################### # Linux AArch64 tarball: linux-aarch64: @@ -222,30 +202,6 @@ jobs: name: aarch64-tarball path: DynamoRIO-AArch64-Linux-${{ steps.version.outputs.version_number }}.tar.gz - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/linux-aarch64 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs - ########################################################################### # Linux ARM tarball (package.cmake does not support same job as AArch64): linux-arm: @@ -311,30 +267,6 @@ jobs: name: arm-tarball path: DynamoRIO-ARM-Linux-EABIHF-${{ steps.version.outputs.version_number }}.tar.gz - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/linux-arm - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs - ########################################################################### # Android ARM tarball: android-arm: @@ -402,30 +334,6 @@ jobs: name: android-tarball path: DynamoRIO-ARM-Android-EABI-${{ steps.version.outputs.version_number }}.tar.gz - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/android-arm - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs - ########################################################################### # Windows .zip with 32-bit and 64-bit x86 builds: windows: @@ -494,30 +402,6 @@ jobs: name: windows-zip path: DynamoRIO-Windows-${{ steps.version.outputs.version_number }}.zip - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/windows - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs - ########################################################################### # Create release and populate with files. # We can't have each OS job create the release because only the first @@ -646,26 +530,21 @@ jobs: asset_name: DynamoRIO-Windows-${{ steps.version.outputs.version_number }}.zip asset_content_type: application/zip - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [create_release, windows, android-arm, linux-arm, linux-aarch64, linux-x86] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/create_release - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action package jobs + test_suite_status: ${{ format('{0} {1} | {2} {3} | {4} {5} | {6} {7} | {8} {9} | {10} {11}', + 'create_release', needs.create_release.result, + 'windows', needs.windows.result, + 'android-arm', needs.android-arm.result, + 'linux-arm', needs.linux-arm.result, + 'linux-aarch64', needs.linux-aarch64.result, + 'linux-x86', needs.linux-x86.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-riscv64.yml b/.github/workflows/ci-riscv64.yml index e5378b0a6a6..08a6bf4e117 100644 --- a/.github/workflows/ci-riscv64.yml +++ b/.github/workflows/ci-riscv64.yml @@ -29,6 +29,10 @@ # DAMAGE. # Github Actions workflow for RISCV64 Continuous Integration testing. +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-riscv64 on: @@ -101,26 +105,15 @@ jobs: CI_BRANCH: ${{ github.ref }} QEMU_LD_PREFIX: /usr/riscv64-linux-gnu/ - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [riscv64-cross-compile] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/aarchxx-cross-compile - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1}', + 'riscv64-cross-compile', needs.riscv64-cross-compile.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 1cd4f0a306b..fe0cc70b5db 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -29,7 +29,11 @@ # DAMAGE. # Github Actions workflow for Windows Continuous Integration testing. - +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. +# # TODO i#2145: point at Qt5 for testing drgui build. name: ci-windows @@ -94,30 +98,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/vs2019-32 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - ########################################################################### # 64-bit VS2019 and tests: vs2019-64: @@ -161,30 +141,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/vs2019-64 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - ########################################################################### # 32-bit and 64-bit VS2019 release builds: vs2019-builds: @@ -228,26 +184,17 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [vs2019-builds, vs2019-64, vs2019-32] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/vs2019-builds - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1} | {2} {3} | {4} {5}', + 'vs2019-builds', needs.vs2019-builds.result, + 'vs2019-64', needs.vs2019-64.result, + 'vs2019-32', needs.vs2019-32.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/ci-x86.yml b/.github/workflows/ci-x86.yml index 9e15d9ea95d..9520c79142b 100644 --- a/.github/workflows/ci-x86.yml +++ b/.github/workflows/ci-x86.yml @@ -29,6 +29,10 @@ # DAMAGE. # Github Actions workflow for x86 Continuous Integration testing. +# +# Each test suite is a separate job. When adding a new test suite job, +# remember to add it to the send-failure-notification job to ensure failure +# notifications are set up properly. name: ci-x86 on: @@ -112,30 +116,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-32 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # 64-bit Linux build with gcc and run tests. x86-64: runs-on: ubuntu-20.04 @@ -174,30 +154,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-64 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # Ubuntu22 64-bit Linux build with gcc and run tests. # XXX: A matrix could combine this with the 20.04 but our auto-cancel # step cancels the 2nd job so we need to solve that first. @@ -238,30 +194,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-64-ubuntu22 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # Ubuntu22 64-bit Linux build with gcc and run tests. # XXX: A matrix could combine this with the 20.04 but our auto-cancel # step cancels the 2nd job so we need to solve that first. @@ -310,30 +242,6 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 - with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-32-ubuntu22 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI - # 64-bit Linux build with gcc and musl. # TODO i#1973: Fix failing cases and enable tests in CI. x86-64-alpine-3_21: @@ -391,26 +299,19 @@ jobs: CI_TRIGGER: ${{ github.event_name }} CI_BRANCH: ${{ github.ref }} - - name: Send failure mail to dynamorio-devs - if: failure() && github.ref == 'refs/heads/master' - uses: dawidd6/action-send-mail@v2 + send-failure-notification: + uses: ./.github/workflows/failure-notification.yml + needs: [x86-32, x86-64, x86-64-ubuntu22, x86-32-ubuntu22, x86-64-alpine-3_21] + # By default, a failure in a job skips the jobs that need it. The + # following expression ensures that failure-notification.yml is + # always invoked. + if: ${{ always() }} with: - server_address: smtp.gmail.com - server_port: 465 - username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} - password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} - subject: | - [${{github.repository}}] ${{github.workflow}} FAILED - on ${{github.event_name}} at ${{github.ref}} - body: | - Github Actions CI workflow run FAILED! - Workflow: ${{github.workflow}}/x86-32-ubuntu22 - Repository: ${{github.repository}} - Branch ref: ${{github.ref}} - SHA: ${{github.sha}} - Triggering actor: ${{github.actor}} - Triggering event: ${{github.event_name}} - Run Id: ${{github.run_id}} - See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} - to: dynamorio-devs@googlegroups.com - from: Github Action CI + test_suite_status: ${{ format('{0} {1} | {2} {3} | {4} {5} | {6} {7} | {8} {9}', + 'x86-32', needs.x86-32.result, + 'x86-64', needs.x86-64.result, + 'x86-64-ubuntu22', needs.x86-64-ubuntu22.result, + 'x86-32-ubuntu22', needs.x86-32-ubuntu22.result, + 'x86-64-alpine-3_21', needs.x86-64-alpine-3_21.result) }} + test_suite_results_only: ${{ join(needs.*.result, ',') }} + secrets: inherit diff --git a/.github/workflows/failure-notification.yml b/.github/workflows/failure-notification.yml new file mode 100644 index 00000000000..319d209b72b --- /dev/null +++ b/.github/workflows/failure-notification.yml @@ -0,0 +1,89 @@ +# ********************************************************** +# Copyright (c) 2025 Google, Inc. All rights reserved. +# ********************************************************** + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the name of Google, Inc. nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +# DAMAGE. + +# Github Actions workflow to send out failure notification emails. +# This is a reusable workflow that is called by various CI workflows. + +name: send-failure-notification +on: + workflow_call: + inputs: + test_suite_status: + required: true + type: string + # We ask for the results only string separately so we can do a + # substring match to check for failure. + test_suite_results_only: + required: true + type: string + secrets: + DYNAMORIO_NOTIFICATION_EMAIL_USERNAME: + required: true + DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD: + required: true + +jobs: + send-failure-notification-job: + runs-on: ubuntu-latest + # Reusable workflows are invoked as a separate job, which requires + # a new runner. But since this job is run only on master merge + # failures, which are expected to be rare, it is fine. + # + # We keep this condition in this reusable workflow to avoid its + # duplication across all callers. Callers should specify an + # always() condition to ensure this reusable workflow is not + # prematurely skipped (since, by default, a failing job skips all + # jobs that need it). Note that the following condition still + # ensures that a new runner or job is not launched when not needed. + if: ${{ contains(inputs.test_suite_results_only, 'failure') && github.ref == 'refs/heads/master' }} + steps: + - name: Send failure mail to dynamorio-devs + uses: dawidd6/action-send-mail@v2 + with: + server_address: smtp.gmail.com + server_port: 465 + username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}} + password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}} + subject: | + [${{github.repository}}] ${{github.workflow}} FAILED + on ${{github.event_name}} at ${{github.ref}} + body: | + Github Actions CI workflow run FAILED! + Workflow: ${{github.workflow}} + All test suite status: ${{ inputs.test_suite_status }} + Repository: ${{github.repository}} + Branch ref: ${{github.ref}} + SHA: ${{github.sha}} + Triggering actor: ${{github.actor}} + Triggering event: ${{github.event_name}} + Run Id: ${{github.run_id}} + See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}} + to: dynamorio-devs@googlegroups.com + from: Github Action CI