From 4a23a419862ef9b7272f411a4435e33fc7305f30 Mon Sep 17 00:00:00 2001 From: Jenna Goldstrich Date: Wed, 7 Apr 2021 12:02:21 -0700 Subject: [PATCH] Introduce slack messages when github actions fail on main Authored-by: Jenna Goldstrich --- .github/workflows/unit_tests.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0b49d2a880d..b49b4e19ff0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -17,6 +17,13 @@ jobs: run: bundle install - name: Run Rubocop run: bundle exec rake rubocop + - uses: ravsamhq/notify-slack-action@v1.1 + if: always() + with: + status: ${{ job.status }} + notify_when: 'failure' # default is 'success,failure,warnings' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required test_postgres: runs-on: ubuntu-latest container: @@ -29,6 +36,13 @@ jobs: run: service postgresql restart - name: Run tests run: DB=postgres bundle exec rake spec:all + - uses: ravsamhq/notify-slack-action@v1.1 + if: always() + with: + status: ${{ job.status }} + notify_when: 'failure' # default is 'success,failure,warnings' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required test_mysql: runs-on: ubuntu-latest container: @@ -43,6 +57,13 @@ jobs: service mysql restart - name: Run tests run: DB=mysql bundle exec rake spec:all + - uses: ravsamhq/notify-slack-action@v1.1 + if: always() + with: + status: ${{ job.status }} + notify_when: 'failure' # default is 'success,failure,warnings' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required test_docs: runs-on: ubuntu-latest container: @@ -57,4 +78,10 @@ jobs: cd - - name: Run docs tests run: bundle exec rake check_doc_links - + - uses: ravsamhq/notify-slack-action@v1.1 + if: always() + with: + status: ${{ job.status }} + notify_when: 'failure' # default is 'success,failure,warnings' + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required