@@ -45,11 +45,17 @@ jobs:
4545 os : macos-latest
4646 - host_target : i686-pc-windows-msvc
4747 os : windows-latest
48+ - host_target : aarch64-pc-windows-msvc
49+ os : windows-11-arm
4850 runs-on : ${{ matrix.os }}
4951 env :
5052 HOST_TARGET : ${{ matrix.host_target }}
5153 steps :
5254 - uses : actions/checkout@v4
55+ - name : apt update
56+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
57+ # The runners seem to have outdated apt repos sometimes
58+ run : sudo apt update
5359 - name : install qemu
5460 if : ${{ matrix.qemu }}
5561 run : sudo apt install qemu-user qemu-user-binfmt
6369 sudo apt update
6470 # Install needed packages
6571 sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
72+ - name : Install rustup on Windows ARM
73+ if : ${{ matrix.os == 'windows-11-arm' }}
74+ run : |
75+ curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
76+ ./rustup-init.exe -y --no-modify-path
77+ echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
6678 - uses : ./.github/workflows/setup
6779 with :
6880 toolchain_flags : " --host ${{ matrix.host_target }}"
@@ -147,35 +159,48 @@ jobs:
147159 - uses : actions/checkout@v4
148160 with :
149161 fetch-depth : 256 # get a bit more of the history
150- - name : install josh-proxy
151- run : cargo +stable install josh-proxy --git https://github.com/josh-project /josh --tag r24.10.04
162+ - name : install josh-sync
163+ run : cargo +stable install --locked --git https://github.com/rust-lang /josh-sync
152164 - name : setup bot git name and email
153165 run : |
154166 git config --global user.name 'The Miri Cronjob Bot'
155167 git config --global user.email '[email protected] ' 156168 - name : Install nightly toolchain
157169 run : rustup toolchain install nightly --profile minimal
158- - name : get changes from rustc
159- run : ./miri rustc-pull
160170 - name : Install rustup-toolchain-install-master
161171 run : cargo install -f rustup-toolchain-install-master
162- - name : format changes (if any)
172+ - name : Push changes to a branch and create PR
163173 run : |
174+ # Make it easier to see what happens.
175+ set -x
176+ # Temporarily disable early exit to examine the status code of rustc-josh-sync
177+ set +e
178+ rustc-josh-sync pull
179+ exitcode=$?
180+ set -e
181+
182+ # If there were no changes to pull, rustc-josh-sync returns status code 2.
183+ # In that case, skip the rest of the job.
184+ if [ $exitcode -eq 2 ]; then
185+ echo "Nothing changed in rustc, skipping PR"
186+ exit 0
187+ elif [ $exitcode -ne 0 ]; then
188+ # If return code was not 0 or 2, rustc-josh-sync actually failed
189+ echo "error: rustc-josh-sync failed"
190+ exit ${exitcode}
191+ fi
192+
193+ # Format changes
164194 ./miri toolchain
165195 ./miri fmt --check || (./miri fmt && git commit -am "fmt")
166- - name : Push changes to a branch and create PR
167- run : |
168- # `git diff --exit-code` "succeeds" if the diff is empty.
169- if git diff --exit-code HEAD^; then echo "Nothing changed in rustc, skipping PR"; exit 0; fi
170- # The diff is non-empty, create a PR.
196+
197+ # Create a PR
171198 BRANCH="rustup-$(date -u +%Y-%m-%d)"
172199 git switch -c $BRANCH
173200 git push -u origin $BRANCH
174201 gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge.'
175202 env :
176203 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
177- ZULIP_BOT_EMAIL : ${{ secrets.ZULIP_BOT_EMAIL }}
178- ZULIP_API_TOKEN : ${{ secrets.ZULIP_API_TOKEN }}
179204
180205 cron-fail-notify :
181206 name : cronjob failure notification
@@ -198,7 +223,7 @@ jobs:
198223 It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
199224
200225 This likely means that rustc changed the miri directory and
201- we now need to do a [`./miri rustc-pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
226+ we now need to do a [`rustc-josh-sync pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
202227
203228 Would you mind investigating this issue?
204229
0 commit comments