1515env :
1616 CARGO_UNSTABLE_SPARSE_REGISTRY : ' true'
1717
18+ defaults :
19+ run :
20+ shell : bash
21+
1822jobs :
1923 build :
2024 runs-on : ${{ matrix.os }}
5963
6064 - name : Install rustup-toolchain-install-master
6165 if : ${{ steps.cache.outputs.cache-hit != 'true' }}
62- shell : bash
63- run : |
64- cargo install -f rustup-toolchain-install-master
66+ run : cargo install -f rustup-toolchain-install-master
6567
6668 - name : Install "master" toolchain
67- shell : bash
6869 run : |
6970 if [[ ${{ github.event_name }} == 'schedule' ]]; then
7071 echo "Building against latest rustc git version"
7980 cargo -V
8081
8182 - name : Test
82- run : bash ./ci.sh
83+ run : ./ci.sh
8384
8485 style :
8586 name : style checks
@@ -111,14 +112,10 @@ jobs:
111112
112113 - name : Install rustup-toolchain-install-master
113114 if : ${{ steps.cache.outputs.cache-hit != 'true' }}
114- shell : bash
115- run : |
116- cargo install -f rustup-toolchain-install-master
115+ run : cargo install -f rustup-toolchain-install-master
117116
118117 - name : Install "master" toolchain
119- shell : bash
120- run : |
121- ./miri toolchain
118+ run : ./miri toolchain
122119
123120 - name : Show Rust version
124121 run : |
@@ -138,7 +135,6 @@ jobs:
138135 # workflow is successful listening to webhooks only.
139136 #
140137 # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
141- # (`fmt` is deliberately not listed, we want bors to ignore it.)
142138 end-success :
143139 name : bors build finished
144140 runs-on : ubuntu-latest
@@ -166,12 +162,12 @@ jobs:
166162 - name : Install zulip-send
167163 run : pip3 install zulip
168164 - name : Send Zulip notification
169- shell : bash
170165 env :
171166 ZULIP_BOT_EMAIL : ${{ secrets.ZULIP_BOT_EMAIL }}
172167 ZULIP_API_TOKEN : ${{ secrets.ZULIP_API_TOKEN }}
173168 run : |
174- ~/.local/bin/zulip-send --stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
169+ ~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
170+ --stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
175171 --message 'Dear @*T-miri*,
176172
177173 It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
@@ -183,9 +179,12 @@ jobs:
183179
184180 Thanks in advance!
185181 Sincerely,
186- The Miri Cronjobs Bot' \
187- --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com
182+ The Miri Cronjobs Bot'
183+
188184 # Attempt to auto-sync with rustc
185+ - uses : actions/checkout@v3
186+ with :
187+ fetch-depth : 256 # get a bit more of the history
189188 - name : install josh-proxy
190189 run : cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
191190 - name : start josh-proxy
@@ -196,16 +195,24 @@ jobs:
196195 git config --global user.email 'miri@cron.bot'
197196 - name : get changes from rustc
198197 run : ./miri rustc-pull
198+ - name : Install rustup-toolchain-install-master
199+ run : cargo install -f rustup-toolchain-install-master
199200 - name : format changes (if any)
200201 run : |
201202 ./miri toolchain
202203 ./miri fmt --check || (./miri fmt && git commit -am "fmt")
203204 - name : Push changes to a branch
204205 run : |
205- git switch -c "rustup$(date -u +%Y-%m)"
206- git push
206+ BRANCH="rustup$(date -u +%Y-%m-%d)"
207+ git switch -c $BRANCH
208+ git push -u origin $BRANCH
207209 - name : Create Pull Request
208- run : gh pr create -B master --title 'Automatic sync from rustc' --body ''
210+ run : |
211+ PR=$(gh pr create -B master --title 'Automatic sync from rustc' --body '')
212+ ~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
213+ --stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
214+ --message "A PR doing a rustc-pull [has been automatically created]($PR) for your convenience."
209215 env :
210216 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
211-
217+ ZULIP_BOT_EMAIL : ${{ secrets.ZULIP_BOT_EMAIL }}
218+ ZULIP_API_TOKEN : ${{ secrets.ZULIP_API_TOKEN }}
0 commit comments