Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 10 additions & 28 deletions .github/workflows/devbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,34 +705,16 @@ jobs:
path: modmesh-pilot-win64/

send_email_on_failure:
name: send_emails_when_fails
needs: [standalone_buffer, build_ubuntu, build_macos, build_windows]
runs-on: ubuntu-latest
# Run if any of the dependencies failed in master branch
if: ${{ always() && contains(needs.*.result, 'failure') && github.ref_name == 'master' && github.event.repository.fork == false }}
steps:
- name: Get current date and set to env
run: |
echo "DATE=$(date +%m/%d)" >> $GITHUB_ENV
- name: Send mail to mailing list
uses: dawidd6/action-send-mail@v6
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# Subject: Uses the Repository name
subject: ${{ env.DATE }} CI Failure in ${{ github.repository }} ${{ github.workflow }} workflow
# Body: Lists the result of every job
body: |
The workflow ${{ github.workflow }} has failed.
Job Status Report:
------------------
- standalone_buffer: ${{ needs.standalone_buffer.result }}
- build_ubuntu: ${{ needs.build_ubuntu.result }}
- build_macos: ${{ needs.build_macos.result }}
- build_windows: ${{ needs.build_windows.result }}

Check the details at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: solvcon@googlegroups.com
from: solvcon_notification
uses: ./.github/workflows/send_email_on_fail.yml
with:
job_results: |
- standalone_buffer: ${{ needs.standalone_buffer.result }}
- build_ubuntu: ${{ needs.build_ubuntu.result }}
- build_macos: ${{ needs.build_macos.result }}
- build_windows: ${{ needs.build_windows.result }}
secrets:
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
36 changes: 9 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,33 +379,15 @@ jobs:
CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"

send_email_on_failure:
name: send_emails_when_fails
needs: [clang_format_check, tidy_flake8_ubuntu, tidy_flake8_macos]
runs-on: ubuntu-latest
# Run if any of the dependencies failed in master branch
if: ${{ always() && contains(needs.*.result, 'failure') && github.ref_name == 'master' && github.event.repository.fork == false }}
steps:
- name: Get current date and set to env
run: |
echo "DATE=$(date +%m/%d)" >> $GITHUB_ENV
- name: Send mail to mailing list
uses: dawidd6/action-send-mail@v6
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# Subject: Uses the Repository name
subject: ${{ env.DATE }} CI Failure in ${{ github.repository }} ${{ github.workflow }} workflow
# Body: Lists the result of every job
body: |
The workflow ${{ github.workflow }} has failed.
Job Status Report:
------------------
- clang_format_check: ${{ needs.clang_format_check.result }}
- tidy_flake8_ubuntu: ${{ needs.tidy_flake8_ubuntu.result }}
- tidy_flake8_macos: ${{ needs.tidy_flake8_macos.result }}

Check the details at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: solvcon@googlegroups.com
from: solvcon_notification
uses: ./.github/workflows/send_email_on_fail.yml
with:
job_results: |
- clang_format_check: ${{ needs.clang_format_check.result }}
- tidy_flake8_ubuntu: ${{ needs.tidy_flake8_ubuntu.result }}
- tidy_flake8_macos: ${{ needs.tidy_flake8_macos.result }}
secrets:
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
34 changes: 8 additions & 26 deletions .github/workflows/nouse_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,32 +228,14 @@ jobs:
cd ..

send_email_on_failure:
name: send_emails_when_fails
needs: [nouse_install_ubuntu, nouse_install_macos]
runs-on: ubuntu-latest
# Run if any of the dependencies failed in master branch
if: ${{ always() && contains(needs.*.result, 'failure') && github.ref_name == 'master' && github.event.repository.fork == false }}
steps:
- name: Get current date and set to env
run: |
echo "DATE=$(date +%m/%d)" >> $GITHUB_ENV
- name: Send mail to mailing list
uses: dawidd6/action-send-mail@v6
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# Subject: Uses the Repository name
subject: ${{ env.DATE }} CI Failure in ${{ github.repository }} ${{ github.workflow }} workflow
# Body: Lists the result of every job
body: |
The workflow ${{ github.workflow }} has failed.
Job Status Report:
------------------
- nouse_install_ubuntu: ${{ needs.nouse_install_ubuntu.result }}
- nouse_install_macos: ${{ needs.nouse_install_macos.result }}

Check the details at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: solvcon@googlegroups.com
from: solvcon_notification
uses: ./.github/workflows/send_email_on_fail.yml
with:
job_results: |
- nouse_install_ubuntu: ${{ needs.nouse_install_ubuntu.result }}
- nouse_install_macos: ${{ needs.nouse_install_macos.result }}
secrets:
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
43 changes: 43 additions & 0 deletions .github/workflows/send_email_on_fail.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the action should use a version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the reference, it states:

  • {owner}/{repo}/.github/workflows/{filename}@{ref} for reusable workflows in public and private repositories.
  • ./.github/workflows/{filename} for reusable workflows in the same repository.

Since we are using a workflow within the same repository, we do not need to specify @{ref} (such as a specific commit SHA, release tag, or branch name).

Regarding the reusable workflow YAML file itself, the official documentation doesn't mention specifying a version inside the file. I think it simply follows the repository’s version control.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. In our case, which uses the action within the same repository, it makes more sense to follow the latest checkin (repository version control).

We should not use a version. I like this conclusion.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Send Email on Failure

on:
workflow_call:
inputs:
job_results:
description: 'String of job results'
required: true
type: string
secrets:
EMAIL_USERNAME:
required: true
EMAIL_PASSWORD:
required: true

jobs:
send_email_on_failure:
name: send_emails_when_fails
runs-on: ubuntu-latest
steps:
- name: Get current date and set to env
run: |
echo "DATE=$(date +%m/%d)" >> $GITHUB_ENV

- name: Send mail to mailing list
uses: dawidd6/action-send-mail@v6
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
# Subject: Uses the Repository name
subject: ${{ env.DATE }} CI Failure in ${{ github.repository }} ${{ github.workflow }} workflow
# Body: Lists the result of every job
body: |
The workflow ${{ github.workflow }} has failed.
Job Status Report:
------------------
${{ inputs.job_results }}

Check the details at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: solvcon@googlegroups.com
from: solvcon_notification
Loading