Skip to content

Commit d1d6f17

Browse files
committed
ci: add slack notifications for failed tests on upstream
Notify on slack when a test fails on the upstream branch (cherry picked from commit 5bdeecb)
1 parent 3e631da commit d1d6f17

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656
# it has been merged.
5757
if: github.event_name == 'pull_request'
5858
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
59+
- name: Notify about failed test
60+
if: ${{ failure() && github.event_name == 'push'}}
61+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
62+
with:
63+
channel-id: 'C015EBF2XB6'
64+
slack-message: 'Lint test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
65+
env:
66+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
5967

6068
api_golden_checks:
6169
runs-on: ubuntu-latest
@@ -72,6 +80,14 @@ jobs:
7280
run: yarn install --frozen-lockfile
7381
- name: Check API Goldens
7482
run: yarn bazel test tools/public_api_guard/...
83+
- name: Notify about failed test
84+
if: ${{ failure() && github.event_name == 'push'}}
85+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
86+
with:
87+
channel-id: 'C015EBF2XB6'
88+
slack-message: 'API Goldens test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
89+
env:
90+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
7591

7692
e2e:
7793
runs-on: ubuntu-latest
@@ -88,6 +104,14 @@ jobs:
88104
run: yarn install --frozen-lockfile
89105
- name: Run e2e tests
90106
run: yarn e2e --flaky_test_attempts=2
107+
- name: Notify about failed test
108+
if: ${{ failure() && github.event_name == 'push'}}
109+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
110+
with:
111+
channel-id: 'C015EBF2XB6'
112+
slack-message: 'E2E test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
113+
env:
114+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
91115

92116
integration:
93117
runs-on: ubuntu-latest
@@ -131,6 +155,14 @@ jobs:
131155
run: yarn install --frozen-lockfile
132156
- name: Run linker AOT tests
133157
run: yarn test-linker-aot
158+
- name: Notify about failed test
159+
if: ${{ failure() && github.event_name == 'push'}}
160+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
161+
with:
162+
channel-id: 'C015EBF2XB6'
163+
slack-message: 'Linker AOT test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
164+
env:
165+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
134166

135167
linker_jit_tests:
136168
runs-on: ubuntu-latest-4core
@@ -147,6 +179,14 @@ jobs:
147179
run: yarn install --frozen-lockfile
148180
- name: Run linker JIT tests
149181
run: yarn test-linker-jit
182+
- name: Notify about failed test
183+
if: ${{ failure() && github.event_name == 'push'}}
184+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
185+
with:
186+
channel-id: 'C015EBF2XB6'
187+
slack-message: 'Linker JIT test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
188+
env:
189+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
150190

151191
test:
152192
runs-on: ubuntu-latest-16core
@@ -163,3 +203,11 @@ jobs:
163203
run: yarn install --frozen-lockfile
164204
- name: Run tests
165205
run: bazel test --build_tag_filters=-e2e --test_tag_filters=-e2e --build_tests_only -- src/...
206+
- name: Notify about failed test
207+
if: ${{ failure() && github.event_name == 'push'}}
208+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
209+
with:
210+
channel-id: 'C015EBF2XB6'
211+
slack-message: 'Browser test job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
212+
env:
213+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

0 commit comments

Comments
 (0)