Skip to content

Commit 92f3240

Browse files
authored
Notify nightly failures (#14049)
* Sending notification when workflow fails * Making the job fail * Adding name and fixing "needs" * Removing unneeded SLACKIFY_MARKDOWN * Making it fail * Setting icon * Making it work again * Rotating light for all
1 parent 036d840 commit 92f3240

File tree

1 file changed

+102
-4
lines changed

1 file changed

+102
-4
lines changed

.github/workflows/nightly.yml

Lines changed: 102 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@ jobs:
3939
export GEM_HOST_API_KEY="Bearer $GITHUB_TOKEN"
4040
bazel run //rb:${{ matrix.gem }}-bump-nightly-version ${{ inputs.version }}
4141
bazel run //rb:${{ matrix.gem }}-release-nightly
42+
on-ruby-failure:
43+
name: On Ruby Failure
44+
runs-on: ubuntu-latest
45+
if: ${{ always() && (needs.ruby.result == 'failure' || needs.ruby.result == 'timed_out') }}
46+
needs: ruby
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Slack Notification
50+
uses: rtCamp/action-slack-notify@v2
51+
env:
52+
SLACK_ICON_EMOJI: ":rotating_light:"
53+
SLACK_COLOR: ${{ needs.ruby.status }}
54+
SLACK_CHANNEL: selenium-tlc
55+
SLACK_USERNAME: GitHub Workflows
56+
SLACK_TITLE: Nightly Ruby ${{ needs.ruby.result }}
57+
MSG_MINIMAL: actions url
58+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
4259

4360
python:
4461
if: (github.repository_owner == 'seleniumhq') && (inputs.language == 'python' || github.event_name == 'schedule')
@@ -53,7 +70,23 @@ jobs:
5370
pip install twine
5471
twine upload --repository testpypi bazel-bin/py/selenium-4*.whl bazel-bin/py/selenium-4*.tar.gz
5572
secrets: inherit
56-
73+
on-python-failure:
74+
name: On Python Failure
75+
runs-on: ubuntu-latest
76+
if: ${{ always() && (needs.python.result == 'failure' || needs.python.result == 'timed_out') }}
77+
needs: python
78+
steps:
79+
- uses: actions/checkout@v4
80+
- name: Slack Notification
81+
uses: rtCamp/action-slack-notify@v2
82+
env:
83+
SLACK_ICON_EMOJI: ":rotating_light:"
84+
SLACK_COLOR: ${{ needs.python.status }}
85+
SLACK_CHANNEL: selenium-tlc
86+
SLACK_USERNAME: GitHub Workflows
87+
SLACK_TITLE: Nightly Python ${{ needs.python.result }}
88+
MSG_MINIMAL: actions url
89+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
5790

5891
java:
5992
if: (github.repository_owner == 'seleniumhq') && (inputs.language == 'java' || github.event_name == 'schedule')
@@ -65,6 +98,23 @@ jobs:
6598
run: |
6699
./go publish-maven-snapshot
67100
secrets: inherit
101+
on-java-failure:
102+
name: On Java Failure
103+
runs-on: ubuntu-latest
104+
if: ${{ always() && (needs.java.result == 'failure' || needs.java.result == 'timed_out') }}
105+
needs: java
106+
steps:
107+
- uses: actions/checkout@v4
108+
- name: Slack Notification
109+
uses: rtCamp/action-slack-notify@v2
110+
env:
111+
SLACK_ICON_EMOJI: ":rotating_light:"
112+
SLACK_COLOR: ${{ needs.java.status }}
113+
SLACK_CHANNEL: selenium-tlc
114+
SLACK_USERNAME: GitHub Workflows
115+
SLACK_TITLE: Nightly Java ${{ needs.java.result }}
116+
MSG_MINIMAL: actions url
117+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
68118

69119
dotnet:
70120
if: (github.repository_owner == 'seleniumhq') && (inputs.language == 'dotnet' || github.event_name == 'schedule')
@@ -78,6 +128,23 @@ jobs:
78128
./go "dotnet:version[nightly]"
79129
./go dotnet:release
80130
secrets: inherit
131+
on-dotnet-failure:
132+
name: On .NET Failure
133+
runs-on: ubuntu-latest
134+
if: ${{ always() && (needs.dotnet.result == 'failure' || needs.dotnet.result == 'timed_out') }}
135+
needs: dotnet
136+
steps:
137+
- uses: actions/checkout@v4
138+
- name: Slack Notification
139+
uses: rtCamp/action-slack-notify@v2
140+
env:
141+
SLACK_ICON_EMOJI: ":rotating_light:"
142+
SLACK_COLOR: ${{ needs.dotnet.status }}
143+
SLACK_CHANNEL: selenium-tlc
144+
SLACK_USERNAME: GitHub Workflows
145+
SLACK_TITLE: Nightly .NET ${{ needs.dotnet.result }}
146+
MSG_MINIMAL: actions url
147+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
81148

82149
grid:
83150
if: (github.repository_owner == 'seleniumhq') && (inputs.language == 'grid' || github.event_name == 'schedule')
@@ -90,6 +157,23 @@ jobs:
90157
echo build --stamp >>.bazelrc.local
91158
./go java-release-zip
92159
nightly-release-files: build/dist/*.*
160+
on-grid-failure:
161+
name: On Grid Failure
162+
runs-on: ubuntu-latest
163+
if: ${{ always() && (needs.grid.result == 'failure' || needs.grid.result == 'timed_out') }}
164+
needs: grid
165+
steps:
166+
- uses: actions/checkout@v4
167+
- name: Slack Notification
168+
uses: rtCamp/action-slack-notify@v2
169+
env:
170+
SLACK_ICON_EMOJI: ":rotating_light:"
171+
SLACK_COLOR: ${{ needs.grid.status }}
172+
SLACK_CHANNEL: selenium-tlc
173+
SLACK_USERNAME: GitHub Workflows
174+
SLACK_TITLE: Nightly Grid ${{ needs.grid.result }}
175+
MSG_MINIMAL: actions url
176+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
93177

94178
javascript:
95179
if: (github.repository_owner == 'seleniumhq') && (inputs.language == 'javascript' || github.event_name == 'schedule')
@@ -103,11 +187,25 @@ jobs:
103187
sed -i 's|https://registry.npmjs.org/|https://npm.pkg.github.com|g' javascript/node/selenium-webdriver/package.json
104188
sed -i 's|"name": "selenium-webdriver"|"name": "@seleniumhq/selenium-webdriver"|g' javascript/node/selenium-webdriver/package.json
105189
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
106-
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
107190
echo "@seleniumhq:registry=https://npm.pkg.github.com" >> ~/.npmrc
108-
echo "@seleniumhq:registry=https://npm.pkg.github.com" >> .npmrc
109191
echo "always-auth=true" >> ~/.npmrc
110-
echo "always-auth=true" >> .npmrc
111192
./go "node:version[nightly]"
112193
./go node:release
113194
secrets: inherit
195+
on-javascript-failure:
196+
name: On JavaScript Failure
197+
runs-on: ubuntu-latest
198+
if: ${{ always() && (needs.javascript.result == 'failure' || needs.javascript.result == 'timed_out') }}
199+
needs: javascript
200+
steps:
201+
- uses: actions/checkout@v4
202+
- name: Slack Notification
203+
uses: rtCamp/action-slack-notify@v2
204+
env:
205+
SLACK_ICON_EMOJI: ":rotating_light:"
206+
SLACK_COLOR: ${{ needs.javascript.status }}
207+
SLACK_CHANNEL: selenium-tlc
208+
SLACK_USERNAME: GitHub Workflows
209+
SLACK_TITLE: Nightly JavaScript ${{ needs.javascript.result }}
210+
MSG_MINIMAL: actions url
211+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)