Skip to content

Commit

Permalink
i#7821: Move failure notification config to reusable workflow
Browse files Browse the repository at this point in the history
Refactors the Github Action configs to move config to send notification email on  master merge failure into a reusable workflow which is now used by all workflows instead of duplicating the logic 19 times.

Issue: #7821
  • Loading branch information
abhinav92003 committed Feb 16, 2025
1 parent 18a77d5 commit a948042
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 559 deletions.
132 changes: 14 additions & 118 deletions .github/workflows/ci-aarchxx-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,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}}/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: [email protected]
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:
Expand Down Expand Up @@ -171,30 +147,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: [email protected]
from: Github Action CI

# Android ARM cross-compile with gcc, no tests:
android-arm-cross-compile:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -243,30 +195,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: [email protected]
from: Github Action CI

# Android AArch64 cross-compile with LLVM, no tests:
android-aarch64-cross-compile:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -309,30 +237,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: [email protected]
from: Github Action CI

# AArch64 drdecode and drmemtrace on x86:
a64-on-x86:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -369,26 +273,18 @@ 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]
# We need this to ensure this job runs even if there is failure in
# any of the workflows marked as needed.
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: [email protected]
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
34 changes: 11 additions & 23 deletions .github/workflows/ci-aarchxx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,14 @@ 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: [email protected]
from: Github Action CI
send-failure-notification:
uses: ./.github/workflows/failure-notification.yml
needs: [aarch64-precommit]
# We need this to ensure this job runs even if there is failure in
# any of the workflows marked as needed.
if: ${{ always() }}
with:
test_suite_status: ${{ format('{0} {1}',
'aarch64-precommit', needs.aarch64-precommit.result) }}
test_suite_results_only: ${{ join(needs.*.result, ',') }}
secrets: inherit
33 changes: 11 additions & 22 deletions .github/workflows/ci-clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,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: [clang-format]
# We need this to ensure this job runs even if there is failure in
# any of the workflows marked as needed.
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: [email protected]
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
32 changes: 10 additions & 22 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,14 @@ 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]
# We need this to ensure this job runs even if there is failure in
# any of the workflows marked as needed.
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: [email protected]
from: Github Action package jobs
test_suite_status: ${{ format('{0} {1}',
'docs', needs.docs.result) }}
test_suite_results_only: ${{ join(needs.*.result, ',') }}
secrets: inherit
32 changes: 10 additions & 22 deletions .github/workflows/ci-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,14 @@ 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]
# We need this to ensure this job runs even if there is failure in
# any of the workflows marked as needed.
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: [email protected]
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
Loading

0 comments on commit a948042

Please sign in to comment.