From 8129c77c84662f465ed75d108f283a301c56fdaf Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 12:22:29 -0700 Subject: [PATCH 1/9] Add test workflow --- .github/workflows/notify.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 00000000..fa5e7c0f --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,31 @@ +name: Notify-test + +on: + push: + branches: mic-4384/notify-cron-fail + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Hello World + run: echo Hello, world! && exit 1 + - name: Send mail + if: (github.event_name == 'schedule' && job.status == 'failure') + uses: dawidd6/action-send-mail@v2 + with: + # mail server settings + server_address: smtp.gmail.com + server_port: 465 + # user credentials + username: ${{ secrets.NOTIFY_EMAIL }} + password: ${{ secrets.NOTIFY_PASSWORD }} + # email subject + subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }} + # email body as text + body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} + # comma-separated string, send email to + to: albrja@uw.edu + # from email name + from: Dr Manhattan \ No newline at end of file From 4f14b2929eb2e62891d9527b2c883261d4e9dcbc Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 12:30:17 -0700 Subject: [PATCH 2/9] Update workflow --- .github/workflows/notify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index fa5e7c0f..c2888f86 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -1,6 +1,7 @@ name: Notify-test on: + workflow_dispatch: push: branches: mic-4384/notify-cron-fail @@ -12,7 +13,7 @@ jobs: - name: Hello World run: echo Hello, world! && exit 1 - name: Send mail - if: (github.event_name == 'schedule' && job.status == 'failure') + if: job.status == 'failure' uses: dawidd6/action-send-mail@v2 with: # mail server settings From d15d95c60108b3c3764a95e2c6b23db74b78a131 Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 12:39:37 -0700 Subject: [PATCH 3/9] Update workflow --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index c2888f86..36911a57 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -13,7 +13,7 @@ jobs: - name: Hello World run: echo Hello, world! && exit 1 - name: Send mail - if: job.status == 'failure' + if: failure() uses: dawidd6/action-send-mail@v2 with: # mail server settings From a3e2d6663d0e116de544368e2ab3d727514b8b00 Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 13:16:39 -0700 Subject: [PATCH 4/9] Update if --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 36911a57..c2888f86 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -13,7 +13,7 @@ jobs: - name: Hello World run: echo Hello, world! && exit 1 - name: Send mail - if: failure() + if: job.status == 'failure' uses: dawidd6/action-send-mail@v2 with: # mail server settings From 4f0cb7ac4b223bd8f5f88f2fa5469696cecd91d2 Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 13:19:53 -0700 Subject: [PATCH 5/9] Revert if to failure callable --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index c2888f86..36911a57 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -13,7 +13,7 @@ jobs: - name: Hello World run: echo Hello, world! && exit 1 - name: Send mail - if: job.status == 'failure' + if: failure() uses: dawidd6/action-send-mail@v2 with: # mail server settings From 7ecc313822b2e4e15f345b272e1cdcd09b6e296d Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 14:50:00 -0700 Subject: [PATCH 6/9] Add notify to build yml --- .github/workflows/build.yml | 19 +++++++++++++++++++ .github/workflows/notify.yml | 32 -------------------------------- 2 files changed, 19 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 285e8e8f..232f7ab4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,3 +50,22 @@ jobs: - name: Doctest run: | make doctest -C docs/ + - name: Send mail + # Notify when cron job fails + if: (github.event_name == 'schedule' && failure()) + uses: dawidd6/action-send-mail@v2 + with: + # mail server settings + server_address: smtp.gmail.com + server_port: 465 + # user credentials + username: ${{ secrets.NOTIFY_EMAIL }} + password: ${{ secrets.NOTIFY_PASSWORD }} + # email subject + subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }} + # email body as text + body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} + # comma-separated string, send email to + to: albrja@uw.edu + # from email name + from: Dr Manhattan diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml deleted file mode 100644 index 36911a57..00000000 --- a/.github/workflows/notify.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Notify-test - -on: - workflow_dispatch: - push: - branches: mic-4384/notify-cron-fail - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Hello World - run: echo Hello, world! && exit 1 - - name: Send mail - if: failure() - uses: dawidd6/action-send-mail@v2 - with: - # mail server settings - server_address: smtp.gmail.com - server_port: 465 - # user credentials - username: ${{ secrets.NOTIFY_EMAIL }} - password: ${{ secrets.NOTIFY_PASSWORD }} - # email subject - subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }} - # email body as text - body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} - # comma-separated string, send email to - to: albrja@uw.edu - # from email name - from: Dr Manhattan \ No newline at end of file From c8568424d09cec2bb7696d02c0f4ab50e935bf58 Mon Sep 17 00:00:00 2001 From: albrja Date: Thu, 19 Oct 2023 15:23:19 -0700 Subject: [PATCH 7/9] Add mail to deploy --- .github/workflows/deploy.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e303098d..a0aebc93 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,4 +28,23 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + twine upload dist/* + - name: Send mail + # Notify when cron job fails + if: failure() + uses: dawidd6/action-send-mail@v2 + with: + # mail server settings + server_address: smtp.gmail.com + server_port: 465 + # user credentials + username: ${{ secrets.NOTIFY_EMAIL }} + password: ${{ secrets.NOTIFY_PASSWORD }} + # email subject + subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }} + # email body as text + body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} + # comma-separated string, send email to + to: albrja@uw.edu + # from email name + from: Dr Manhattan \ No newline at end of file From 7b1abce225961caeafde90bc3bd533a640d9efd7 Mon Sep 17 00:00:00 2001 From: albrja Date: Fri, 20 Oct 2023 16:37:18 -0700 Subject: [PATCH 8/9] Update recipent email --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 232f7ab4..99edd895 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,6 +66,6 @@ jobs: # email body as text body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} # comma-separated string, send email to - to: albrja@uw.edu + to: uw_ihme_simulationscience@uw.edu # from email name from: Dr Manhattan From bc2269ced917dac59c50a2dbd4149e61359fa887 Mon Sep 17 00:00:00 2001 From: albrja Date: Mon, 23 Oct 2023 11:48:44 -0700 Subject: [PATCH 9/9] Update email address recipient for deploy fail --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a0aebc93..bf1ee6c2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,6 +45,6 @@ jobs: # email body as text body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }} # comma-separated string, send email to - to: albrja@uw.edu + to: uw_ihme_simulationscience@uw.edu # from email name from: Dr Manhattan \ No newline at end of file