diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 547f8fa98..ec9c475f6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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/slack-github-action@v1.24.0 + 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: