From 268dd0e641b9c05cd92ad7f48e5cba9bd8b3ea09 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 4 Apr 2024 17:23:22 +0530 Subject: [PATCH] Add Slack alerts to CI workflows on failures --- .gitea/workflows/fixturenet-eth-plugeth-arm-test.yml | 8 ++++++++ .gitea/workflows/fixturenet-eth-plugeth-test.yml | 8 ++++++++ .gitea/workflows/fixturenet-eth-test.yml | 9 ++++++++- .gitea/workflows/fixturenet-laconicd-test.yml | 8 ++++++++ .gitea/workflows/lint.yml | 8 ++++++++ .gitea/workflows/publish.yml | 8 ++++++++ .gitea/workflows/test-container-registry.yml | 9 ++++++++- .gitea/workflows/test-database.yml | 9 ++++++++- .gitea/workflows/test-deploy.yml | 8 ++++++++ .gitea/workflows/test-k8s-deploy.yml | 8 ++++++++ .gitea/workflows/test-webapp.yml | 8 ++++++++ .gitea/workflows/test.yml | 10 ++++++++-- 12 files changed, 96 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml index 92ddd5dc..b51123b4 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-arm-test.yml @@ -43,3 +43,11 @@ jobs: run: ./scripts/build_shiv_package.sh - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-eth-plugeth-test.yml b/.gitea/workflows/fixturenet-eth-plugeth-test.yml index 11bca169..d31b2afa 100644 --- a/.gitea/workflows/fixturenet-eth-plugeth-test.yml +++ b/.gitea/workflows/fixturenet-eth-plugeth-test.yml @@ -47,3 +47,11 @@ jobs: sleep 5 - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth-plugeth/run-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-eth-test.yml b/.gitea/workflows/fixturenet-eth-test.yml index 73804df5..dab3fa7e 100644 --- a/.gitea/workflows/fixturenet-eth-test.yml +++ b/.gitea/workflows/fixturenet-eth-test.yml @@ -45,4 +45,11 @@ jobs: sleep 5 - name: "Run fixturenet-eth tests" run: ./tests/fixturenet-eth/run-test.sh - + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/fixturenet-laconicd-test.yml b/.gitea/workflows/fixturenet-laconicd-test.yml index c8c3991e..34fb5b07 100644 --- a/.gitea/workflows/fixturenet-laconicd-test.yml +++ b/.gitea/workflows/fixturenet-laconicd-test.yml @@ -48,3 +48,11 @@ jobs: run: ./tests/fixturenet-laconicd/run-test.sh - name: "Run laconic CLI tests" run: ./tests/fixturenet-laconicd/run-cli-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index f9be1e6b..182ff05f 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -19,3 +19,11 @@ jobs: python-version: '3.8' - name : "Run flake8" uses: py-actions/flake8@v2 + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index ffbb9937..05769c63 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -54,3 +54,11 @@ jobs: # Hack using endsWith to workaround Gitea sometimes sending "publish-test" vs "refs/heads/publish-test" draft: ${{ endsWith('publish-test', github.ref ) }} files: ./laconic-so + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-container-registry.yml b/.gitea/workflows/test-container-registry.yml index 3358aa09..c87be3a6 100644 --- a/.gitea/workflows/test-container-registry.yml +++ b/.gitea/workflows/test-container-registry.yml @@ -51,4 +51,11 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/container-registry/run-test.sh - + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-database.yml b/.gitea/workflows/test-database.yml index b925271b..23737bbb 100644 --- a/.gitea/workflows/test-database.yml +++ b/.gitea/workflows/test-database.yml @@ -49,4 +49,11 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/database/run-test.sh - + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-deploy.yml b/.gitea/workflows/test-deploy.yml index 6e47c82d..5ed214c8 100644 --- a/.gitea/workflows/test-deploy.yml +++ b/.gitea/workflows/test-deploy.yml @@ -47,3 +47,11 @@ jobs: sleep 5 - name: "Run deploy tests" run: ./tests/deploy/run-deploy-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-k8s-deploy.yml b/.gitea/workflows/test-k8s-deploy.yml index 7df39132..14f1afcd 100644 --- a/.gitea/workflows/test-k8s-deploy.yml +++ b/.gitea/workflows/test-k8s-deploy.yml @@ -51,4 +51,12 @@ jobs: source /opt/bash-utils/cgroup-helper.sh join_cgroup ./tests/k8s-deploy/run-deploy-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test-webapp.yml b/.gitea/workflows/test-webapp.yml index 8b83c606..e09ee100 100644 --- a/.gitea/workflows/test-webapp.yml +++ b/.gitea/workflows/test-webapp.yml @@ -49,3 +49,11 @@ jobs: sleep 5 - name: "Run webapp tests" run: ./tests/webapp-test/run-webapp-test.sh + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }} diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 193e27c9..cd0f1a72 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -47,5 +47,11 @@ jobs: sleep 5 - name: "Run smoke tests" run: ./tests/smoke-test/run-smoke-test.sh - - + - name: Notify Slack on CI failure + if: always() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }}