@@ -61,15 +61,17 @@ jobs:
61
61
restore-keys : ${{ runner.os }}-cargo
62
62
63
63
- name : Install rustup-toolchain-install-master and xargo
64
+ shell : bash
64
65
run : |
65
66
cargo install rustup-toolchain-install-master
66
67
cargo install xargo
67
- shell : bash
68
68
69
69
- name : Install "master" toolchain
70
+ shell : bash
70
71
run : |
71
72
if [[ ${{ github.event_name }} == 'schedule' ]]; then
72
73
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
74
+ exit 1 # just to test cron notifications
73
75
else
74
76
RUSTC_HASH=$(< rust-version)
75
77
fi
81
83
-c llvm-tools \
82
84
--host ${{ matrix.host_target }}
83
85
rustup default master
84
- shell : bash
85
86
86
87
- name : Show Rust version
87
88
run : |
@@ -113,3 +114,22 @@ jobs:
113
114
steps :
114
115
- name : mark the job as a failure
115
116
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