From 475ab109e1b88cba320257dce7c431fe7f127b9e Mon Sep 17 00:00:00 2001 From: Paul Adkisson Date: Fri, 3 May 2024 16:31:23 -0400 Subject: [PATCH] added dailies with email notifs (#320) --- .github/workflows/dailies.yaml | 30 +++++++++++++++++++++++ .github/workflows/run-tests.yml | 13 +--------- .github/workflows/update-testing-data.yml | 2 -- 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/dailies.yaml diff --git a/.github/workflows/dailies.yaml b/.github/workflows/dailies.yaml new file mode 100644 index 00000000..25c77980 --- /dev/null +++ b/.github/workflows/dailies.yaml @@ -0,0 +1,30 @@ +name: Daily Workflows + +on: + workflow_dispatch: + schedule: + - cron: "0 14 * * *" # Daily at 10am EST + +jobs: + update-testing-data: + uses: ./.github/workflows/update-testing-data.yml + + run-tests: + needs: update-testing-data + uses: ./.github/workflows/run-tests.yml + + notify: + runs-on: ubuntu-latest + needs: [update-testing-data, run-tests] + if: ${{ always() && contains(needs.*.result, 'failure') }} + steps: + - uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 # TSL + username: ${{ secrets.MAIL_USERNAME }} + password: ${{ secrets.MAIL_PASSWORD }} + subject: ROIExtractors Daily Failure + to: ${{ secrets.DAILY_FAILURE_EMAIL_LIST }} # add more with commas, no separation + from: NWB Inspector + body: "The daily workflow for ROIExtractors failed: please check status at https://github.com/catalystneuro/roiextractors/actions/workflows/dailies.yml" diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ac903b3f..c4774412 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,23 +2,12 @@ name: Full Tests on: pull_request: workflow_dispatch: - workflow_run: - workflows: [update-testing-data] - types: [completed] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - on-failure: - name: Notify on failure - runs-on: ${{ matrix.os }} - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - run: | - echo 'The triggering workflow failed.' - 0 assess-file-changes: uses: ./.github/workflows/assess-file-changes.yml @@ -35,7 +24,7 @@ jobs: echo "CHANGELOG.md has not been updated." 0 - on-success: + run: name: Full tests on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: diff --git a/.github/workflows/update-testing-data.yml b/.github/workflows/update-testing-data.yml index a7f59dfd..0b73f906 100644 --- a/.github/workflows/update-testing-data.yml +++ b/.github/workflows/update-testing-data.yml @@ -1,7 +1,5 @@ name: update-testing-data on: - schedule: - - cron: "0 0 * * *" # daily workflow_dispatch: jobs: