]> git.lizzy.rs Git - rust.git/blob - src/ci/github-actions/ci.yml
Rollup merge of #107706 - tgross35:atomic-as-mut-ptr, r=m-ou-se
[rust.git] / src / ci / github-actions / ci.yml
1 ######################################################
2 #   WARNING! Action needed when changing this file   #
3 ######################################################
4
5 # Due to GitHub Actions limitations, we can't use YAML Anchors directly in the
6 # CI configuration stored on the repository. To work around that this file is
7 # expanded by a tool in the repository, and the expansion is committed as well.
8 #
9 # After you make any change to the file you'll need to run this command:
10 #
11 #   ./x.py run src/tools/expand-yaml-anchors
12 #
13 # ...and commit the file it updated in addition to this one. If you forget this
14 # step CI will fail.
15
16 ---
17
18 ###############################
19 #   YAML Anchors Definition   #
20 ###############################
21
22 # This key contains most of the YAML anchors that will be used later in the
23 # document. YAML anchors allows us to greatly reduce duplication inside the CI
24 # configuration by reusing parts of the configuration.
25 #
26 # YAML anchors work by defining an anchor with `&anchor-name` and reusing its
27 # content in another place with `*anchor-name`. The special `<<` map key merges
28 # the content of the map with the content of the anchor (or list of anchors).
29 #
30 # The expand-yaml-anchors tool will automatically remove this block from the
31 # output YAML file.
32 x--expand-yaml-anchors--remove:
33
34   - &shared-ci-variables
35     CI_JOB_NAME: ${{ matrix.name }}
36     CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
37
38   - &public-variables
39     SCCACHE_BUCKET: rust-lang-ci-sccache2
40     TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
41     CACHE_DOMAIN: ci-caches.rust-lang.org
42
43   - &prod-variables
44     SCCACHE_BUCKET: rust-lang-ci-sccache2
45     DEPLOY_BUCKET: rust-lang-ci2
46     TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
47     TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
48     TOOLSTATE_PUBLISH: 1
49     # AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
50     # AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
51     # rotate them in a single branch while keeping the old key in another
52     # branch, which wouldn't be possible if the key was named with the kind
53     # (caches, artifacts...).
54     CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
55     ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
56     CACHE_DOMAIN: ci-caches.rust-lang.org
57
58   - &dummy-variables
59     SCCACHE_BUCKET: rust-lang-gha-caches
60     DEPLOY_BUCKET: rust-lang-gha
61     TOOLSTATE_REPO: https://github.com/pietroalbini/rust-toolstate
62     TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/pietroalbini/rust-toolstate/issues
63     TOOLSTATE_PUBLISH: 1
64     # AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
65     # AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
66     # rotate them in a single branch while keeping the old key in another
67     # branch, which wouldn't be possible if the key was named with the kind
68     # (caches, artifacts...).
69     CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZOMUQATD5
70     ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZH5AYXDVF
71     CACHE_DOMAIN: ci-caches-gha.rust-lang.org
72
73   - &base-job
74     env: {}
75
76   - &job-linux-xl
77     os: ubuntu-20.04-xl
78     <<: *base-job
79
80   - &job-macos-xl
81     os: macos-latest  # We don't have an XL builder for this
82     <<: *base-job
83
84   - &job-windows-xl
85     os: windows-latest-xl
86     <<: *base-job
87
88   - &job-aarch64-linux
89     os: [self-hosted, ARM64, linux]
90
91   - &step
92     if: success() && !env.SKIP_JOB
93
94   - &base-ci-job
95     timeout-minutes: 600
96     runs-on: "${{ matrix.os }}"
97     env: *shared-ci-variables
98     steps:
99       - name: disable git crlf conversion
100         run: git config --global core.autocrlf false
101
102       - name: checkout the source code
103         uses: actions/checkout@v3
104         with:
105           fetch-depth: 2
106
107       # Rust Log Analyzer can't currently detect the PR number of a GitHub
108       # Actions build on its own, so a hint in the log message is needed to
109       # point it in the right direction.
110       - name: configure the PR in which the error message will be posted
111         run: echo "[CI_PR_NUMBER=$num]"
112         env:
113           num: ${{ github.event.number }}
114         if: success() && !env.SKIP_JOB && github.event_name == 'pull_request'
115
116       - name: add extra environment variables
117         run: src/ci/scripts/setup-environment.sh
118         env:
119           # Since it's not possible to merge `${{ matrix.env }}` with the other
120           # variables in `job.<name>.env`, the variables defined in the matrix
121           # are passed to the `setup-environment.sh` script encoded in JSON,
122           # which then uses log commands to actually set them.
123           EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
124         <<: *step
125
126       - name: decide whether to skip this job
127         run: src/ci/scripts/should-skip-this.sh
128         <<: *step
129
130       - name: ensure the channel matches the target branch
131         run: src/ci/scripts/verify-channel.sh
132         <<: *step
133
134       - name: configure GitHub Actions to kill the build when outdated
135         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
136         with:
137           github_token: "${{ secrets.github_token }}"
138         if: success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && github.ref != 'refs/heads/try-perf'
139         <<: *step
140
141       - name: collect CPU statistics
142         run: src/ci/scripts/collect-cpu-stats.sh
143         <<: *step
144
145       - name: show the current environment
146         run: src/ci/scripts/dump-environment.sh
147         <<: *step
148
149       - name: install awscli
150         run: src/ci/scripts/install-awscli.sh
151         <<: *step
152
153       - name: install sccache
154         run: src/ci/scripts/install-sccache.sh
155         <<: *step
156
157       - name: select Xcode
158         run: src/ci/scripts/select-xcode.sh
159         <<: *step
160
161       - name: install clang
162         run: src/ci/scripts/install-clang.sh
163         <<: *step
164
165       - name: install WIX
166         run: src/ci/scripts/install-wix.sh
167         <<: *step
168
169       - name: disable git crlf conversion
170         run: src/ci/scripts/disable-git-crlf-conversion.sh
171         <<: *step
172
173       - name: checkout submodules
174         run: src/ci/scripts/checkout-submodules.sh
175         <<: *step
176
177       - name: install MSYS2
178         run: src/ci/scripts/install-msys2.sh
179         <<: *step
180
181       - name: install MinGW
182         run: src/ci/scripts/install-mingw.sh
183         <<: *step
184
185       - name: install ninja
186         run: src/ci/scripts/install-ninja.sh
187         <<: *step
188
189       - name: enable ipv6 on Docker
190         run: src/ci/scripts/enable-docker-ipv6.sh
191         <<: *step
192
193       # Disable automatic line ending conversion (again). On Windows, when we're
194       # installing dependencies, something switches the git configuration directory or
195       # re-enables autocrlf. We've not tracked down the exact cause -- and there may
196       # be multiple -- but this should ensure submodules are checked out with the
197       # appropriate line endings.
198       - name: disable git crlf conversion
199         run: src/ci/scripts/disable-git-crlf-conversion.sh
200         <<: *step
201
202       - name: ensure line endings are correct
203         run: src/ci/scripts/verify-line-endings.sh
204         <<: *step
205
206       - name: ensure backported commits are in upstream branches
207         run: src/ci/scripts/verify-backported-commits.sh
208         <<: *step
209
210       - name: ensure the stable version number is correct
211         run: src/ci/scripts/verify-stable-version-number.sh
212         <<: *step
213
214       - name: run the build
215         run: src/ci/scripts/run-build-from-ci.sh
216         env:
217           AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
218           AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
219           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
220         <<: *step
221
222       - name: upload artifacts to S3
223         run: src/ci/scripts/upload-artifacts.sh
224         env:
225           AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
226           AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
227         # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
228         # builders *should* have the AWS credentials available. Still, explicitly
229         # adding the condition is helpful as this way CI will not silently skip
230         # deploying artifacts from a dist builder if the variables are misconfigured,
231         # erroring about invalid credentials instead.
232         if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
233         <<: *step
234
235   # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
236   # Check out their documentation for more information on why they're needed.
237
238   - &base-outcome-job
239     name: bors build finished
240     runs-on: ubuntu-latest
241
242   - &base-success-job
243     steps:
244       - name: mark the job as a success
245         run: exit 0
246         shell: bash
247     <<: *base-outcome-job
248
249   - &base-failure-job
250     steps:
251       - name: mark the job as a failure
252         run: exit 1
253         shell: bash
254     <<: *base-outcome-job
255
256 ###########################
257 #   Builders definition   #
258 ###########################
259
260 name: CI
261 on:
262   push:
263     branches:
264       - auto
265       - try
266       - try-perf
267       - master
268   pull_request:
269     branches:
270       - "**"
271
272 permissions:
273   contents: read
274
275 defaults:
276   run:
277     # On Linux, macOS, and Windows, use the system-provided bash as the default
278     # shell. (This should only make a difference on Windows, where the default
279     # shell is PowerShell.)
280     shell: bash
281
282 jobs:
283   pr:
284     permissions:
285       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
286     <<: *base-ci-job
287     name: PR
288     env:
289       <<: [*shared-ci-variables, *public-variables]
290     if: github.event_name == 'pull_request'
291     continue-on-error: ${{ matrix.tidy }}
292     strategy:
293       matrix:
294         include:
295           - name: mingw-check
296             <<: *job-linux-xl
297             tidy: false
298
299           - name: mingw-check-tidy
300             <<: *job-linux-xl
301             tidy: true
302
303           - name: x86_64-gnu-llvm-13
304             <<: *job-linux-xl
305             tidy: false
306
307           - name: x86_64-gnu-tools
308             <<: *job-linux-xl
309             tidy: false
310
311   auto:
312     permissions:
313       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
314     <<: *base-ci-job
315     name: auto
316     env:
317       <<: [*shared-ci-variables, *prod-variables]
318     if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
319     strategy:
320       matrix:
321         include:
322           #############################
323           #   Linux/Docker builders   #
324           #############################
325
326           - name: aarch64-gnu
327             <<: *job-aarch64-linux
328
329           - name: arm-android
330             <<: *job-linux-xl
331
332           - name: armhf-gnu
333             <<: *job-linux-xl
334
335           - name: dist-aarch64-linux
336             <<: *job-linux-xl
337
338           - name: dist-android
339             <<: *job-linux-xl
340
341           - name: dist-arm-linux
342             <<: *job-linux-xl
343
344           - name: dist-armhf-linux
345             <<: *job-linux-xl
346
347           - name: dist-armv7-linux
348             <<: *job-linux-xl
349
350           - name: dist-i586-gnu-i586-i686-musl
351             <<: *job-linux-xl
352
353           - name: dist-i686-linux
354             <<: *job-linux-xl
355
356           - name: dist-mips-linux
357             <<: *job-linux-xl
358
359           - name: dist-mips64-linux
360             <<: *job-linux-xl
361
362           - name: dist-mips64el-linux
363             <<: *job-linux-xl
364
365           - name: dist-mipsel-linux
366             <<: *job-linux-xl
367
368           - name: dist-powerpc-linux
369             <<: *job-linux-xl
370
371           - name: dist-powerpc64-linux
372             <<: *job-linux-xl
373
374           - name: dist-powerpc64le-linux
375             <<: *job-linux-xl
376
377           - name: dist-riscv64-linux
378             <<: *job-linux-xl
379
380           - name: dist-s390x-linux
381             <<: *job-linux-xl
382
383           - name: dist-various-1
384             <<: *job-linux-xl
385
386           - name: dist-various-2
387             <<: *job-linux-xl
388
389           - name: dist-x86_64-freebsd
390             <<: *job-linux-xl
391
392           - name: dist-x86_64-illumos
393             <<: *job-linux-xl
394
395           - &dist-x86_64-linux
396             name: dist-x86_64-linux
397             <<: *job-linux-xl
398
399           - name: dist-x86_64-linux-alt
400             env:
401               IMAGE: dist-x86_64-linux
402             <<: *job-linux-xl
403
404           - name: dist-x86_64-musl
405             <<: *job-linux-xl
406
407           - name: dist-x86_64-netbsd
408             <<: *job-linux-xl
409
410           - name: i686-gnu
411             <<: *job-linux-xl
412
413           - name: i686-gnu-nopt
414             <<: *job-linux-xl
415
416           - name: mingw-check
417             <<: *job-linux-xl
418
419           - name: test-various
420             <<: *job-linux-xl
421
422           - name: wasm32
423             <<: *job-linux-xl
424
425           - name: x86_64-gnu
426             <<: *job-linux-xl
427
428           # This job ensures commits landing on nightly still pass the full
429           # test suite on the stable channel. There are some UI tests that
430           # depend on the channel being built (for example if they include the
431           # channel name on the output), and this builder prevents landing
432           # changes that would result in broken builds after a promotion.
433           - name: x86_64-gnu-stable
434             env:
435               IMAGE: x86_64-gnu
436               RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
437               # Only run this job on the nightly channel. Running this on beta
438               # could cause failures when `dev: 1` in `stage0.txt`, and running
439               # this on stable is useless.
440               CI_ONLY_WHEN_CHANNEL: nightly
441             <<: *job-linux-xl
442
443           - name: x86_64-gnu-aux
444             <<: *job-linux-xl
445
446           - name: x86_64-gnu-debug
447             <<: *job-linux-xl
448
449           - name: x86_64-gnu-distcheck
450             <<: *job-linux-xl
451
452           - name: x86_64-gnu-llvm-15
453             env:
454               RUST_BACKTRACE: 1
455             <<: *job-linux-xl
456
457           - name: x86_64-gnu-llvm-14
458             env:
459               RUST_BACKTRACE: 1
460             <<: *job-linux-xl
461
462           - name: x86_64-gnu-llvm-13
463             env:
464               RUST_BACKTRACE: 1
465             <<: *job-linux-xl
466
467           - name: x86_64-gnu-llvm-13-stage1
468             env:
469               RUST_BACKTRACE: 1
470             <<: *job-linux-xl
471
472           - name: x86_64-gnu-nopt
473             <<: *job-linux-xl
474
475           - name: x86_64-gnu-tools
476             env:
477               DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
478             <<: *job-linux-xl
479
480           ####################
481           #  macOS Builders  #
482           ####################
483
484           - name: dist-x86_64-apple
485             env:
486               SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin
487               RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin
488               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
489               MACOSX_DEPLOYMENT_TARGET: 10.7
490               SELECT_XCODE: /Applications/Xcode_13.4.1.app
491               NO_LLVM_ASSERTIONS: 1
492               NO_DEBUG_ASSERTIONS: 1
493               NO_OVERFLOW_CHECKS: 1
494               DIST_REQUIRE_ALL_TOOLS: 1
495             <<: *job-macos-xl
496
497           - name: dist-apple-various
498             env:
499               SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
500               RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
501               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
502               MACOSX_DEPLOYMENT_TARGET: 10.7
503               SELECT_XCODE: /Applications/Xcode_13.4.1.app
504               NO_LLVM_ASSERTIONS: 1
505               NO_DEBUG_ASSERTIONS: 1
506               NO_OVERFLOW_CHECKS: 1
507             <<: *job-macos-xl
508
509           - name: dist-x86_64-apple-alt
510             env:
511               SCRIPT: ./x.py dist bootstrap --include-default-paths
512               RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false
513               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
514               MACOSX_DEPLOYMENT_TARGET: 10.7
515               SELECT_XCODE: /Applications/Xcode_13.4.1.app
516               NO_LLVM_ASSERTIONS: 1
517               NO_DEBUG_ASSERTIONS: 1
518               NO_OVERFLOW_CHECKS: 1
519             <<: *job-macos-xl
520
521           - name: x86_64-apple-1
522             env: &env-x86_64-apple-tests
523               SCRIPT: ./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps
524               RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
525               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
526               MACOSX_DEPLOYMENT_TARGET: 10.8
527               MACOSX_STD_DEPLOYMENT_TARGET: 10.7
528               NO_LLVM_ASSERTIONS: 1
529               NO_DEBUG_ASSERTIONS: 1
530               NO_OVERFLOW_CHECKS: 1
531             <<: *job-macos-xl
532
533           - name: x86_64-apple-2
534             env:
535               SCRIPT: ./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps
536               <<: *env-x86_64-apple-tests
537             <<: *job-macos-xl
538
539           # This target only needs to support 11.0 and up as nothing else supports the hardware
540           - name: dist-aarch64-apple
541             env:
542               SCRIPT: ./x.py dist bootstrap --include-default-paths --stage 2
543               RUST_CONFIGURE_ARGS: >-
544                 --build=x86_64-apple-darwin
545                 --host=aarch64-apple-darwin
546                 --target=aarch64-apple-darwin
547                 --enable-full-tools
548                 --enable-sanitizers
549                 --enable-profiler
550                 --disable-docs
551                 --set rust.jemalloc
552                 --set llvm.ninja=false
553               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
554               SELECT_XCODE: /Applications/Xcode_13.4.1.app
555               USE_XCODE_CLANG: 1
556               MACOSX_DEPLOYMENT_TARGET: 11.0
557               MACOSX_STD_DEPLOYMENT_TARGET: 11.0
558               NO_LLVM_ASSERTIONS: 1
559               NO_DEBUG_ASSERTIONS: 1
560               NO_OVERFLOW_CHECKS: 1
561               DIST_REQUIRE_ALL_TOOLS: 1
562               # Corresponds to 16K page size
563               #
564               # Shouldn't be needed if jemalloc-sys is updated to
565               # handle this platform like iOS or if we build on
566               # aarch64-apple-darwin itself.
567               #
568               # https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237
569               JEMALLOC_SYS_WITH_LG_PAGE: 14
570             <<: *job-macos-xl
571
572           ######################
573           #  Windows Builders  #
574           ######################
575
576           - name: x86_64-msvc-1
577             env:
578               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
579               SCRIPT: make ci-subset-1
580             <<: *job-windows-xl
581
582           - name: x86_64-msvc-2
583             env:
584               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
585               SCRIPT: make ci-subset-2
586             <<: *job-windows-xl
587
588           - name: i686-msvc-1
589             env:
590               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
591               SCRIPT: make ci-subset-1
592             <<: *job-windows-xl
593
594           - name: i686-msvc-2
595             env:
596               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
597               SCRIPT: make ci-subset-2
598             <<: *job-windows-xl
599
600           - name: x86_64-msvc-cargo
601             env:
602               SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo
603               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld
604             <<: *job-windows-xl
605
606           - name: x86_64-msvc-tools
607             env:
608               SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
609               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
610               DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
611             <<: *job-windows-xl
612
613           # 32/64-bit MinGW builds.
614           #
615           # We are using MinGW with POSIX threads since LLVM requires
616           # C++'s std::thread which is disabled in libstdc++ with win32 threads.
617           # FIXME: Libc++ doesn't have this limitation so we can avoid
618           # winpthreads if we switch to it.
619           #
620           # Instead of relying on the MinGW version installed on CI we download
621           # and install one ourselves so we won't be surprised by changes to CI's
622           # build image.
623           #
624           # Finally, note that the downloads below are all in the `rust-lang-ci` S3
625           # bucket, but they clearly didn't originate there! The downloads originally
626           # came from the mingw-w64 SourceForge download site. Unfortunately
627           # SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
628
629           - name: i686-mingw-1
630             env:
631               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
632               SCRIPT: make ci-mingw-subset-1
633               # We are intentionally allowing an old toolchain on this builder (and that's
634               # incompatible with LLVM downloads today).
635               NO_DOWNLOAD_CI_LLVM: 1
636               CUSTOM_MINGW: 1
637             <<: *job-windows-xl
638
639           - name: i686-mingw-2
640             env:
641               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu
642               SCRIPT: make ci-mingw-subset-2
643               # We are intentionally allowing an old toolchain on this builder (and that's
644               # incompatible with LLVM downloads today).
645               NO_DOWNLOAD_CI_LLVM: 1
646               CUSTOM_MINGW: 1
647             <<: *job-windows-xl
648
649           - name: x86_64-mingw-1
650             env:
651               SCRIPT: make ci-mingw-subset-1
652               RUST_CONFIGURE_ARGS: >-
653                 --build=x86_64-pc-windows-gnu
654                 --enable-profiler
655               # We are intentionally allowing an old toolchain on this builder (and that's
656               # incompatible with LLVM downloads today).
657               NO_DOWNLOAD_CI_LLVM: 1
658               CUSTOM_MINGW: 1
659             <<: *job-windows-xl
660
661           - name: x86_64-mingw-2
662             env:
663               SCRIPT: make ci-mingw-subset-2
664               RUST_CONFIGURE_ARGS: >-
665                 --build=x86_64-pc-windows-gnu
666                 --enable-profiler
667               # We are intentionally allowing an old toolchain on this builder (and that's
668               # incompatible with LLVM downloads today).
669               NO_DOWNLOAD_CI_LLVM: 1
670               CUSTOM_MINGW: 1
671             <<: *job-windows-xl
672
673           - name: dist-x86_64-msvc
674             env:
675               RUST_CONFIGURE_ARGS: >-
676                 --build=x86_64-pc-windows-msvc
677                 --host=x86_64-pc-windows-msvc
678                 --target=x86_64-pc-windows-msvc
679                 --enable-full-tools
680                 --enable-profiler
681                 --set rust.lto=thin
682               SCRIPT: PGO_HOST=x86_64-pc-windows-msvc python src/ci/stage-build.py python x.py dist bootstrap --include-default-paths
683               DIST_REQUIRE_ALL_TOOLS: 1
684             <<: *job-windows-xl
685
686           - name: dist-i686-msvc
687             env:
688               RUST_CONFIGURE_ARGS: >-
689                 --build=i686-pc-windows-msvc
690                 --host=i686-pc-windows-msvc
691                 --target=i686-pc-windows-msvc,i586-pc-windows-msvc
692                 --enable-full-tools
693                 --enable-profiler
694               SCRIPT: python x.py dist bootstrap --include-default-paths
695               DIST_REQUIRE_ALL_TOOLS: 1
696             <<: *job-windows-xl
697
698           - name: dist-aarch64-msvc
699             env:
700               RUST_CONFIGURE_ARGS: >-
701                 --build=x86_64-pc-windows-msvc
702                 --host=aarch64-pc-windows-msvc
703                 --enable-full-tools
704                 --enable-profiler
705               SCRIPT: python x.py dist bootstrap --include-default-paths
706               DIST_REQUIRE_ALL_TOOLS: 1
707               # Hack around this SDK version, because it doesn't work with clang.
708               # See https://github.com/rust-lang/rust/issues/88796
709               WINDOWS_SDK_20348_HACK: 1
710             <<: *job-windows-xl
711
712           - name: dist-i686-mingw
713             env:
714               RUST_CONFIGURE_ARGS: >-
715                 --build=i686-pc-windows-gnu
716                 --enable-full-tools
717                 --enable-profiler
718               # We are intentionally allowing an old toolchain on this builder (and that's
719               # incompatible with LLVM downloads today).
720               NO_DOWNLOAD_CI_LLVM: 1
721               SCRIPT: python x.py dist bootstrap --include-default-paths
722               CUSTOM_MINGW: 1
723               DIST_REQUIRE_ALL_TOOLS: 1
724             <<: *job-windows-xl
725
726           - name: dist-x86_64-mingw
727             env:
728               SCRIPT: python x.py dist bootstrap --include-default-paths
729               RUST_CONFIGURE_ARGS: >-
730                 --build=x86_64-pc-windows-gnu
731                 --enable-full-tools
732                 --enable-profiler
733               # We are intentionally allowing an old toolchain on this builder (and that's
734               # incompatible with LLVM downloads today).
735               NO_DOWNLOAD_CI_LLVM: 1
736               CUSTOM_MINGW: 1
737               DIST_REQUIRE_ALL_TOOLS: 1
738             <<: *job-windows-xl
739
740           - name: dist-x86_64-msvc-alt
741             env:
742               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
743               SCRIPT: python x.py dist bootstrap --include-default-paths
744             <<: *job-windows-xl
745
746   try:
747     permissions:
748       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
749     <<: *base-ci-job
750     name: try
751     env:
752       <<: [*shared-ci-variables, *prod-variables]
753     if: github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'
754     strategy:
755       matrix:
756         include:
757           - &dist-x86_64-linux
758             name: dist-x86_64-linux
759             <<: *job-linux-xl
760
761   master:
762     name: master
763     runs-on: ubuntu-latest
764     env:
765       <<: [*prod-variables]
766     if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'
767     steps:
768       - name: checkout the source code
769         uses: actions/checkout@v3
770         with:
771           fetch-depth: 2
772
773       - name: publish toolstate
774         run: src/ci/publish_toolstate.sh
775         shell: bash
776         env:
777           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
778         <<: *step
779
780   # These jobs don't actually test anything, but they're used to tell bors the
781   # build completed, as there is no practical way to detect when a workflow is
782   # successful listening to webhooks only.
783   try-success:
784     needs: [try]
785     if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
786     <<: *base-success-job
787   try-failure:
788     needs: [try]
789     if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
790     <<: *base-failure-job
791   auto-success:
792     needs: [auto]
793     if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
794     <<: *base-success-job
795   auto-failure:
796     needs: [auto]
797     if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
798     <<: *base-failure-job