Skip to content

Commit

Permalink
send slack notification on unit test failure (#667)
Browse files Browse the repository at this point in the history
* slack notification

* code review
  • Loading branch information
claytonneal authored Feb 4, 2024
1 parent 42d76bb commit f77ab7f
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Unit Tests

on: [push, pull_request]
on:
push:
branches:
- 'master'
- 'master-*'

pull_request:
branches:
- master

jobs:
unit_tests:
Expand All @@ -27,7 +35,22 @@ jobs:
run: make all

- name: Make Test
id: unit-test
run: make test

- name: Post To Slack
if: always() && github.ref == 'refs/heads/master' && (steps.unit-test.outcome == 'failure')
uses: slackapi/[email protected]
with:
payload: |
{
"source": "GitHub",
"repo": "${{ github.repository}}",
"branch": "${{ github.head_ref || github.ref_name }}",
"message": "unit tests failed on ${{ matrix.os }} with go version ${{ matrix.go-version }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
test_coverage:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit f77ab7f

Please sign in to comment.