From fc5f2947a0d5043770b810f6b09ffb358d2eaeef Mon Sep 17 00:00:00 2001 From: Lahiru Maramba Date: Tue, 30 Mar 2021 16:58:54 -0400 Subject: [PATCH] Add send email action in nightly workflow --- .github/workflows/nightly.yml | 26 ++++++++++++++++++++++++++ test/integration/remote-config.spec.ts | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 10221dac24..cef38604f5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -66,3 +66,29 @@ jobs: with: name: dist path: dist + + - name: Send email on failure + if: failure() + uses: ./.github/actions/send-email + with: + api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }} + domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }} + from: 'GitHub ' + to: ${{ secrets.ADMIN_GITHUB_NOTIFICATION_EMAIL }} + subject: '[${{github.repository}}] Nightly build failed!' + html: > + Nightly build failed on: github.com/${{github.repository}} + continue-on-error: true + + - name: Send email on cancelled + if: cancelled() + uses: ./.github/actions/send-email + with: + api-key: ${{ secrets.OSS_BOT_MAILGUN_KEY }} + domain: ${{ secrets.OSS_BOT_MAILGUN_DOMAIN }} + from: 'GitHub ' + to: ${{ secrets.ADMIN_GITHUB_NOTIFICATION_EMAIL }} + subject: '[${{github.repository}}] Nightly build got cancelled!' + html: > + Nightly build got cancelled on: github.com/${{github.repository}} + continue-on-error: true diff --git a/test/integration/remote-config.spec.ts b/test/integration/remote-config.spec.ts index f8773c1b3c..eebab8a770 100644 --- a/test/integration/remote-config.spec.ts +++ b/test/integration/remote-config.spec.ts @@ -88,6 +88,12 @@ describe('admin.remoteConfig', () => { }).to.throw('Cannot set property etag of # which has only a getter'); }); + // A failing integration test to trigger the send email action. + // Remove this once the testing is complete. + it('A failing integration test to trigger nightly email notifications', () => { + expect('a').to.be.equal('b'); + }); + describe('validateTemplate', () => { it('should succeed with a vaild template', () => { // set parameters, groups, and conditions