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