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