Skip to content

Commit 838de0e

Browse files
committed
Auto merge of #1667 - RalfJung:cron-fail-notification, r=RalfJung
send Zulip notification when cron job fails Let's see if this works...
2 parents a09f8b0 + 333d7bb commit 838de0e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/ci.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ jobs:
6161
restore-keys: ${{ runner.os }}-cargo
6262

6363
- name: Install rustup-toolchain-install-master and xargo
64+
shell: bash
6465
run: |
6566
cargo install rustup-toolchain-install-master
6667
cargo install xargo
67-
shell: bash
6868
6969
- name: Install "master" toolchain
70+
shell: bash
7071
run: |
7172
if [[ ${{ github.event_name }} == 'schedule' ]]; then
7273
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
74+
exit 1 # just to test cron notifications
7375
else
7476
RUSTC_HASH=$(< rust-version)
7577
fi
@@ -81,7 +83,6 @@ jobs:
8183
-c llvm-tools \
8284
--host ${{ matrix.host_target }}
8385
rustup default master
84-
shell: bash
8586
8687
- name: Show Rust version
8788
run: |
@@ -113,3 +114,22 @@ jobs:
113114
steps:
114115
- name: mark the job as a failure
115116
run: exit 1
117+
118+
# Send a Zulip notification when a cron job fails
119+
cron-fail-notify:
120+
name: cronjob failure notification
121+
runs-on: ubuntu-latest
122+
needs: [build]
123+
if: github.event_name == 'schedule' && (failure() || cancelled())
124+
steps:
125+
- name: Install zulip-send
126+
run: pip3 install zulip
127+
- name: Send Zulip notification
128+
shell: bash
129+
env:
130+
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
131+
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
132+
run: |
133+
zulip-send --stream miri --subject "Cron Job Failure" \
134+
--message '@**RalfJ** @**oli** the Miri cron job build failed. Please investigate!' \
135+
--user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN

0 commit comments

Comments
 (0)