]> git.lizzy.rs Git - rust.git/blob - src/ci/github-actions/ci.yml
Rollup merge of #106057 - jyn514:trimmed-def-paths-ice, r=compiler-errors
[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     strategy:
291       matrix:
292         include:
293           - name: mingw-check
294             <<: *job-linux-xl
295
296           - name: x86_64-gnu-llvm-13
297             <<: *job-linux-xl
298
299           - name: x86_64-gnu-tools
300             env:
301               CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
302             <<: *job-linux-xl
303
304   auto:
305     permissions:
306       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
307     <<: *base-ci-job
308     name: auto
309     env:
310       <<: [*shared-ci-variables, *prod-variables]
311     if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
312     strategy:
313       matrix:
314         include:
315           #############################
316           #   Linux/Docker builders   #
317           #############################
318
319           - name: aarch64-gnu
320             <<: *job-aarch64-linux
321
322           - name: arm-android
323             <<: *job-linux-xl
324
325           - name: armhf-gnu
326             <<: *job-linux-xl
327
328           - name: dist-aarch64-linux
329             <<: *job-linux-xl
330
331           - name: dist-android
332             <<: *job-linux-xl
333
334           - name: dist-arm-linux
335             <<: *job-linux-xl
336
337           - name: dist-armhf-linux
338             <<: *job-linux-xl
339
340           - name: dist-armv7-linux
341             <<: *job-linux-xl
342
343           - name: dist-i586-gnu-i586-i686-musl
344             <<: *job-linux-xl
345
346           - name: dist-i686-linux
347             <<: *job-linux-xl
348
349           - name: dist-mips-linux
350             <<: *job-linux-xl
351
352           - name: dist-mips64-linux
353             <<: *job-linux-xl
354
355           - name: dist-mips64el-linux
356             <<: *job-linux-xl
357
358           - name: dist-mipsel-linux
359             <<: *job-linux-xl
360
361           - name: dist-powerpc-linux
362             <<: *job-linux-xl
363
364           - name: dist-powerpc64-linux
365             <<: *job-linux-xl
366
367           - name: dist-powerpc64le-linux
368             <<: *job-linux-xl
369
370           - name: dist-riscv64-linux
371             <<: *job-linux-xl
372
373           - name: dist-s390x-linux
374             <<: *job-linux-xl
375
376           - name: dist-various-1
377             <<: *job-linux-xl
378
379           - name: dist-various-2
380             <<: *job-linux-xl
381
382           - name: dist-x86_64-freebsd
383             <<: *job-linux-xl
384
385           - name: dist-x86_64-illumos
386             <<: *job-linux-xl
387
388           - &dist-x86_64-linux
389             name: dist-x86_64-linux
390             <<: *job-linux-xl
391
392           - name: dist-x86_64-linux-alt
393             env:
394               IMAGE: dist-x86_64-linux
395             <<: *job-linux-xl
396
397           - name: dist-x86_64-musl
398             <<: *job-linux-xl
399
400           - name: dist-x86_64-netbsd
401             <<: *job-linux-xl
402
403           - name: i686-gnu
404             <<: *job-linux-xl
405
406           - name: i686-gnu-nopt
407             <<: *job-linux-xl
408
409           - name: mingw-check
410             <<: *job-linux-xl
411
412           - name: test-various
413             <<: *job-linux-xl
414
415           - name: wasm32
416             <<: *job-linux-xl
417
418           - name: x86_64-gnu
419             <<: *job-linux-xl
420
421           # This job ensures commits landing on nightly still pass the full
422           # test suite on the stable channel. There are some UI tests that
423           # depend on the channel being built (for example if they include the
424           # channel name on the output), and this builder prevents landing
425           # changes that would result in broken builds after a promotion.
426           - name: x86_64-gnu-stable
427             env:
428               IMAGE: x86_64-gnu
429               RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
430               # Only run this job on the nightly channel. Running this on beta
431               # could cause failures when `dev: 1` in `stage0.txt`, and running
432               # this on stable is useless.
433               CI_ONLY_WHEN_CHANNEL: nightly
434             <<: *job-linux-xl
435
436           - name: x86_64-gnu-aux
437             <<: *job-linux-xl
438
439           - name: x86_64-gnu-debug
440             <<: *job-linux-xl
441
442           - name: x86_64-gnu-distcheck
443             <<: *job-linux-xl
444
445           - name: x86_64-gnu-llvm-13
446             env:
447               RUST_BACKTRACE: 1
448             <<: *job-linux-xl
449
450           - name: x86_64-gnu-llvm-13-stage1
451             env:
452               RUST_BACKTRACE: 1
453             <<: *job-linux-xl
454
455           - name: x86_64-gnu-nopt
456             <<: *job-linux-xl
457
458           - name: x86_64-gnu-tools
459             env:
460               DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
461             <<: *job-linux-xl
462
463           ####################
464           #  macOS Builders  #
465           ####################
466
467           - name: dist-x86_64-apple
468             env:
469               SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin
470               RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin
471               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
472               MACOSX_DEPLOYMENT_TARGET: 10.7
473               SELECT_XCODE: /Applications/Xcode_13.4.1.app
474               NO_LLVM_ASSERTIONS: 1
475               NO_DEBUG_ASSERTIONS: 1
476               NO_OVERFLOW_CHECKS: 1
477               DIST_REQUIRE_ALL_TOOLS: 1
478             <<: *job-macos-xl
479
480           - name: dist-apple-various
481             env:
482               SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
483               RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
484               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
485               MACOSX_DEPLOYMENT_TARGET: 10.7
486               SELECT_XCODE: /Applications/Xcode_13.4.1.app
487               NO_LLVM_ASSERTIONS: 1
488               NO_DEBUG_ASSERTIONS: 1
489               NO_OVERFLOW_CHECKS: 1
490             <<: *job-macos-xl
491
492           - name: dist-x86_64-apple-alt
493             env:
494               SCRIPT: ./x.py dist bootstrap --include-default-paths
495               RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false
496               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
497               MACOSX_DEPLOYMENT_TARGET: 10.7
498               SELECT_XCODE: /Applications/Xcode_13.4.1.app
499               NO_LLVM_ASSERTIONS: 1
500               NO_DEBUG_ASSERTIONS: 1
501               NO_OVERFLOW_CHECKS: 1
502             <<: *job-macos-xl
503
504           - name: x86_64-apple-1
505             env: &env-x86_64-apple-tests
506               SCRIPT: ./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps
507               RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
508               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
509               MACOSX_DEPLOYMENT_TARGET: 10.8
510               MACOSX_STD_DEPLOYMENT_TARGET: 10.7
511               NO_LLVM_ASSERTIONS: 1
512               NO_DEBUG_ASSERTIONS: 1
513               NO_OVERFLOW_CHECKS: 1
514             <<: *job-macos-xl
515
516           - name: x86_64-apple-2
517             env:
518               SCRIPT: ./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps
519               <<: *env-x86_64-apple-tests
520             <<: *job-macos-xl
521
522           # This target only needs to support 11.0 and up as nothing else supports the hardware
523           - name: dist-aarch64-apple
524             env:
525               SCRIPT: ./x.py dist bootstrap --include-default-paths --stage 2
526               RUST_CONFIGURE_ARGS: >-
527                 --build=x86_64-apple-darwin
528                 --host=aarch64-apple-darwin
529                 --target=aarch64-apple-darwin
530                 --enable-full-tools
531                 --enable-sanitizers
532                 --enable-profiler
533                 --disable-docs
534                 --set rust.jemalloc
535                 --set llvm.ninja=false
536               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
537               SELECT_XCODE: /Applications/Xcode_13.4.1.app
538               USE_XCODE_CLANG: 1
539               MACOSX_DEPLOYMENT_TARGET: 11.0
540               MACOSX_STD_DEPLOYMENT_TARGET: 11.0
541               NO_LLVM_ASSERTIONS: 1
542               NO_DEBUG_ASSERTIONS: 1
543               NO_OVERFLOW_CHECKS: 1
544               DIST_REQUIRE_ALL_TOOLS: 1
545               # Corresponds to 16K page size
546               #
547               # Shouldn't be needed if jemalloc-sys is updated to
548               # handle this platform like iOS or if we build on
549               # aarch64-apple-darwin itself.
550               #
551               # https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237
552               JEMALLOC_SYS_WITH_LG_PAGE: 14
553             <<: *job-macos-xl
554
555           ######################
556           #  Windows Builders  #
557           ######################
558
559           - name: x86_64-msvc-1
560             env:
561               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
562               SCRIPT: make ci-subset-1
563             <<: *job-windows-xl
564
565           - name: x86_64-msvc-2
566             env:
567               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
568               SCRIPT: make ci-subset-2
569             <<: *job-windows-xl
570
571           - name: i686-msvc-1
572             env:
573               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
574               SCRIPT: make ci-subset-1
575             <<: *job-windows-xl
576
577           - name: i686-msvc-2
578             env:
579               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
580               SCRIPT: make ci-subset-2
581             <<: *job-windows-xl
582
583           - name: x86_64-msvc-cargo
584             env:
585               SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo
586               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld
587             <<: *job-windows-xl
588
589           - name: x86_64-msvc-tools
590             env:
591               SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
592               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
593               DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
594             <<: *job-windows-xl
595
596           # 32/64-bit MinGW builds.
597           #
598           # We are using MinGW with POSIX threads since LLVM requires
599           # C++'s std::thread which is disabled in libstdc++ with win32 threads.
600           # FIXME: Libc++ doesn't have this limitation so we can avoid
601           # winpthreads if we switch to it.
602           #
603           # Instead of relying on the MinGW version installed on CI we download
604           # and install one ourselves so we won't be surprised by changes to CI's
605           # build image.
606           #
607           # Finally, note that the downloads below are all in the `rust-lang-ci` S3
608           # bucket, but they clearly didn't originate there! The downloads originally
609           # came from the mingw-w64 SourceForge download site. Unfortunately
610           # SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
611
612           - name: i686-mingw-1
613             env:
614               RUST_CONFIGURE_ARGS: >-
615                 --build=i686-pc-windows-gnu
616                 --set llvm.allow-old-toolchain
617               SCRIPT: make ci-mingw-subset-1
618               # We are intentionally allowing an old toolchain on this builder (and that's
619               # incompatible with LLVM downloads today).
620               NO_DOWNLOAD_CI_LLVM: 1
621               CUSTOM_MINGW: 1
622             <<: *job-windows-xl
623
624           - name: i686-mingw-2
625             env:
626               RUST_CONFIGURE_ARGS: >-
627                 --build=i686-pc-windows-gnu
628                 --set llvm.allow-old-toolchain
629               SCRIPT: make ci-mingw-subset-2
630               # We are intentionally allowing an old toolchain on this builder (and that's
631               # incompatible with LLVM downloads today).
632               NO_DOWNLOAD_CI_LLVM: 1
633               CUSTOM_MINGW: 1
634             <<: *job-windows-xl
635
636           - name: x86_64-mingw-1
637             env:
638               SCRIPT: make ci-mingw-subset-1
639               RUST_CONFIGURE_ARGS: >-
640                 --build=x86_64-pc-windows-gnu
641                 --enable-profiler
642                 --set llvm.allow-old-toolchain
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-2
650             env:
651               SCRIPT: make ci-mingw-subset-2
652               RUST_CONFIGURE_ARGS: >-
653                 --build=x86_64-pc-windows-gnu
654                 --enable-profiler
655                 --set llvm.allow-old-toolchain
656               # We are intentionally allowing an old toolchain on this builder (and that's
657               # incompatible with LLVM downloads today).
658               NO_DOWNLOAD_CI_LLVM: 1
659               CUSTOM_MINGW: 1
660             <<: *job-windows-xl
661
662           - name: dist-x86_64-msvc
663             env:
664               RUST_CONFIGURE_ARGS: >-
665                 --build=x86_64-pc-windows-msvc
666                 --host=x86_64-pc-windows-msvc
667                 --target=x86_64-pc-windows-msvc
668                 --enable-full-tools
669                 --enable-profiler
670                 --set rust.lto=thin
671               SCRIPT: PGO_HOST=x86_64-pc-windows-msvc src/ci/pgo.sh python x.py dist bootstrap --include-default-paths
672               DIST_REQUIRE_ALL_TOOLS: 1
673             <<: *job-windows-xl
674
675           - name: dist-i686-msvc
676             env:
677               RUST_CONFIGURE_ARGS: >-
678                 --build=i686-pc-windows-msvc
679                 --host=i686-pc-windows-msvc
680                 --target=i686-pc-windows-msvc,i586-pc-windows-msvc
681                 --enable-full-tools
682                 --enable-profiler
683               SCRIPT: python x.py dist bootstrap --include-default-paths
684               DIST_REQUIRE_ALL_TOOLS: 1
685             <<: *job-windows-xl
686
687           - name: dist-aarch64-msvc
688             env:
689               RUST_CONFIGURE_ARGS: >-
690                 --build=x86_64-pc-windows-msvc
691                 --host=aarch64-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               # Hack around this SDK version, because it doesn't work with clang.
697               # See https://github.com/rust-lang/rust/issues/88796
698               WINDOWS_SDK_20348_HACK: 1
699             <<: *job-windows-xl
700
701           - name: dist-i686-mingw
702             env:
703               RUST_CONFIGURE_ARGS: >-
704                 --build=i686-pc-windows-gnu
705                 --enable-full-tools
706                 --enable-profiler
707                 --set llvm.allow-old-toolchain
708               # We are intentionally allowing an old toolchain on this builder (and that's
709               # incompatible with LLVM downloads today).
710               NO_DOWNLOAD_CI_LLVM: 1
711               SCRIPT: python x.py dist bootstrap --include-default-paths
712               CUSTOM_MINGW: 1
713               DIST_REQUIRE_ALL_TOOLS: 1
714             <<: *job-windows-xl
715
716           - name: dist-x86_64-mingw
717             env:
718               SCRIPT: python x.py dist bootstrap --include-default-paths
719               RUST_CONFIGURE_ARGS: >-
720                 --build=x86_64-pc-windows-gnu
721                 --enable-full-tools
722                 --enable-profiler
723                 --set llvm.allow-old-toolchain
724               # We are intentionally allowing an old toolchain on this builder (and that's
725               # incompatible with LLVM downloads today).
726               NO_DOWNLOAD_CI_LLVM: 1
727               CUSTOM_MINGW: 1
728               DIST_REQUIRE_ALL_TOOLS: 1
729             <<: *job-windows-xl
730
731           - name: dist-x86_64-msvc-alt
732             env:
733               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
734               SCRIPT: python x.py dist bootstrap --include-default-paths
735             <<: *job-windows-xl
736
737   try:
738     permissions:
739       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
740     <<: *base-ci-job
741     name: try
742     env:
743       <<: [*shared-ci-variables, *prod-variables]
744     if: github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'
745     strategy:
746       matrix:
747         include:
748           - &dist-x86_64-linux
749             name: dist-x86_64-linux
750             <<: *job-linux-xl
751
752   master:
753     name: master
754     runs-on: ubuntu-latest
755     env:
756       <<: [*prod-variables]
757     if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'
758     steps:
759       - name: checkout the source code
760         uses: actions/checkout@v3
761         with:
762           fetch-depth: 2
763
764       - name: publish toolstate
765         run: src/ci/publish_toolstate.sh
766         shell: bash
767         env:
768           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
769         <<: *step
770
771   # These jobs don't actually test anything, but they're used to tell bors the
772   # build completed, as there is no practical way to detect when a workflow is
773   # successful listening to webhooks only.
774   try-success:
775     needs: [try]
776     if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
777     <<: *base-success-job
778   try-failure:
779     needs: [try]
780     if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
781     <<: *base-failure-job
782   auto-success:
783     needs: [auto]
784     if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
785     <<: *base-success-job
786   auto-failure:
787     needs: [auto]
788     if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
789     <<: *base-failure-job