forked from vechain/thor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send slack notification on unit test failure (vechain#667)
* slack notification * code review
- Loading branch information
1 parent
42d76bb
commit f77ab7f
Showing
1 changed file
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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: | ||
|