From 91bc31772ab7e92c16f3d71118b73fd716cfa9a2 Mon Sep 17 00:00:00 2001 From: maciektr Date: Tue, 7 Nov 2023 13:02:05 +0100 Subject: [PATCH] Add scheduled tests job (#864) --- .github/workflows/check.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 21 +++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 000000000..85a5cdd7a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,32 @@ +name: Scheduled tests + +on: + workflow_dispatch: + schedule: + - cron: '0 5 * * *' + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + check: + uses: ./.github/workflows/_check-release.yml + with: + fail-fast: false + + notify-failed: + runs-on: ubuntu-latest + # Do not run on success + if: always() && contains(needs.*.result, 'failure') + needs: [ check ] + steps: + - name: Notifying about failed tests! + uses: slackapi/slack-github-action@v1.24.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SCHEDULED_TESTS_FAILURE_WEBHOOK_URL }} + with: + payload: | + { + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 53f09e357..0f0ea4900 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -171,8 +171,8 @@ jobs: notify_failed: runs-on: ubuntu-latest # Do not run on dry_run or success - if: always() && ${{ !(inputs.dry_run) }} && contains(needs.*.result, 'failure') - needs: [ cleanup, upload, release, check, prepare ] + if: always() && !(inputs.dry_run) && contains(needs.*.result, 'failure') + needs: [ cleanup, upload, release, prepare ] steps: - name: Notifying about Nightly fail! uses: slackapi/slack-github-action@v1.24.0 @@ -183,3 +183,20 @@ jobs: { "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" } + + + notify_failed_check: + runs-on: ubuntu-latest + # Do not run on dry_run, check success or if we have already notified + if: always() && !(inputs.dry_run) && needs.check.result == 'failure' && needs.notify_failed.result == 'skipped' + needs: [ check, notify_failed ] + steps: + - name: Notifying about check fail! + uses: slackapi/slack-github-action@v1.24.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NIGHTLY_CHECK_FAILURE_WEBHOOK_URL }} + with: + payload: | + { + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + }