]> git.lizzy.rs Git - rust.git/blob - src/ci/github-actions/ci.yml
Rollup merge of #102195 - wesleywiser:copyright2, r=Mark-Simulacrum,joshtriplett
[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-latest  # We don't have an XL builder for this
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: install clang
157         run: src/ci/scripts/install-clang.sh
158         <<: *step
159
160       - name: install WIX
161         run: src/ci/scripts/install-wix.sh
162         <<: *step
163
164       - name: disable git crlf conversion
165         run: src/ci/scripts/disable-git-crlf-conversion.sh
166         <<: *step
167
168       - name: checkout submodules
169         run: src/ci/scripts/checkout-submodules.sh
170         <<: *step
171
172       - name: install MSYS2
173         run: src/ci/scripts/install-msys2.sh
174         <<: *step
175
176       - name: install MinGW
177         run: src/ci/scripts/install-mingw.sh
178         <<: *step
179
180       - name: install ninja
181         run: src/ci/scripts/install-ninja.sh
182         <<: *step
183
184       - name: enable ipv6 on Docker
185         run: src/ci/scripts/enable-docker-ipv6.sh
186         <<: *step
187
188       # Disable automatic line ending conversion (again). On Windows, when we're
189       # installing dependencies, something switches the git configuration directory or
190       # re-enables autocrlf. We've not tracked down the exact cause -- and there may
191       # be multiple -- but this should ensure submodules are checked out with the
192       # appropriate line endings.
193       - name: disable git crlf conversion
194         run: src/ci/scripts/disable-git-crlf-conversion.sh
195         <<: *step
196
197       - name: ensure line endings are correct
198         run: src/ci/scripts/verify-line-endings.sh
199         <<: *step
200
201       - name: ensure backported commits are in upstream branches
202         run: src/ci/scripts/verify-backported-commits.sh
203         <<: *step
204
205       - name: ensure the stable version number is correct
206         run: src/ci/scripts/verify-stable-version-number.sh
207         <<: *step
208
209       - name: run the build
210         run: src/ci/scripts/run-build-from-ci.sh
211         env:
212           AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
213           AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
214           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
215         <<: *step
216
217       - name: upload artifacts to S3
218         run: src/ci/scripts/upload-artifacts.sh
219         env:
220           AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
221           AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
222         # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
223         # builders *should* have the AWS credentials available. Still, explicitly
224         # adding the condition is helpful as this way CI will not silently skip
225         # deploying artifacts from a dist builder if the variables are misconfigured,
226         # erroring about invalid credentials instead.
227         if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
228         <<: *step
229
230   # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
231   # Check out their documentation for more information on why they're needed.
232
233   - &base-outcome-job
234     name: bors build finished
235     runs-on: ubuntu-latest
236
237   - &base-success-job
238     steps:
239       - name: mark the job as a success
240         run: exit 0
241         shell: bash
242     <<: *base-outcome-job
243
244   - &base-failure-job
245     steps:
246       - name: mark the job as a failure
247         run: exit 1
248         shell: bash
249     <<: *base-outcome-job
250
251 ###########################
252 #   Builders definition   #
253 ###########################
254
255 name: CI
256 on:
257   push:
258     branches:
259       - auto
260       - try
261       - try-perf
262       - master
263   pull_request:
264     branches:
265       - "**"
266
267 permissions:
268   contents: read
269
270 defaults:
271   run:
272     # On Linux, macOS, and Windows, use the system-provided bash as the default
273     # shell. (This should only make a difference on Windows, where the default
274     # shell is PowerShell.)
275     shell: bash
276
277 jobs:
278   pr:
279     permissions:
280       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
281     <<: *base-ci-job
282     name: PR
283     env:
284       <<: [*shared-ci-variables, *public-variables]
285     if: github.event_name == 'pull_request'
286     strategy:
287       matrix:
288         include:
289           - name: mingw-check
290             <<: *job-linux-xl
291
292           - name: x86_64-gnu-llvm-13
293             <<: *job-linux-xl
294
295           - name: x86_64-gnu-tools
296             env:
297               CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
298             <<: *job-linux-xl
299
300   auto:
301     permissions:
302       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
303     <<: *base-ci-job
304     name: auto
305     env:
306       <<: [*shared-ci-variables, *prod-variables]
307     if: github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'
308     strategy:
309       matrix:
310         include:
311           #############################
312           #   Linux/Docker builders   #
313           #############################
314
315           - name: aarch64-gnu
316             <<: *job-aarch64-linux
317
318           - name: arm-android
319             <<: *job-linux-xl
320
321           - name: armhf-gnu
322             <<: *job-linux-xl
323
324           - name: dist-aarch64-linux
325             <<: *job-linux-xl
326
327           - name: dist-android
328             <<: *job-linux-xl
329
330           - name: dist-arm-linux
331             <<: *job-linux-xl
332
333           - name: dist-armhf-linux
334             <<: *job-linux-xl
335
336           - name: dist-armv7-linux
337             <<: *job-linux-xl
338
339           - name: dist-i586-gnu-i586-i686-musl
340             <<: *job-linux-xl
341
342           - name: dist-i686-linux
343             <<: *job-linux-xl
344
345           - name: dist-mips-linux
346             <<: *job-linux-xl
347
348           - name: dist-mips64-linux
349             <<: *job-linux-xl
350
351           - name: dist-mips64el-linux
352             <<: *job-linux-xl
353
354           - name: dist-mipsel-linux
355             <<: *job-linux-xl
356
357           - name: dist-powerpc-linux
358             <<: *job-linux-xl
359
360           - name: dist-powerpc64-linux
361             <<: *job-linux-xl
362
363           - name: dist-powerpc64le-linux
364             <<: *job-linux-xl
365
366           - name: dist-riscv64-linux
367             <<: *job-linux-xl
368
369           - name: dist-s390x-linux
370             <<: *job-linux-xl
371
372           - name: dist-various-1
373             <<: *job-linux-xl
374
375           - name: dist-various-2
376             <<: *job-linux-xl
377
378           - name: dist-x86_64-freebsd
379             <<: *job-linux-xl
380
381           - name: dist-x86_64-illumos
382             <<: *job-linux-xl
383
384           - &dist-x86_64-linux
385             name: dist-x86_64-linux
386             <<: *job-linux-xl
387
388           - name: dist-x86_64-linux-alt
389             env:
390               IMAGE: dist-x86_64-linux
391             <<: *job-linux-xl
392
393           - name: dist-x86_64-musl
394             <<: *job-linux-xl
395
396           - name: dist-x86_64-netbsd
397             <<: *job-linux-xl
398
399           - name: i686-gnu
400             <<: *job-linux-xl
401
402           - name: i686-gnu-nopt
403             <<: *job-linux-xl
404
405           - name: mingw-check
406             <<: *job-linux-xl
407
408           - name: test-various
409             <<: *job-linux-xl
410
411           - name: wasm32
412             <<: *job-linux-xl
413
414           - name: x86_64-gnu
415             <<: *job-linux-xl
416
417           # This job ensures commits landing on nightly still pass the full
418           # test suite on the stable channel. There are some UI tests that
419           # depend on the channel being built (for example if they include the
420           # channel name on the output), and this builder prevents landing
421           # changes that would result in broken builds after a promotion.
422           - name: x86_64-gnu-stable
423             env:
424               IMAGE: x86_64-gnu
425               RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
426               # Only run this job on the nightly channel. Running this on beta
427               # could cause failures when `dev: 1` in `stage0.txt`, and running
428               # this on stable is useless.
429               CI_ONLY_WHEN_CHANNEL: nightly
430             <<: *job-linux-xl
431
432           - name: x86_64-gnu-aux
433             <<: *job-linux-xl
434
435           - name: x86_64-gnu-debug
436             <<: *job-linux-xl
437
438           - name: x86_64-gnu-distcheck
439             <<: *job-linux-xl
440
441           - name: x86_64-gnu-llvm-13
442             env:
443               RUST_BACKTRACE: 1
444             <<: *job-linux-xl
445
446           - name: x86_64-gnu-llvm-13-stage1
447             env:
448               RUST_BACKTRACE: 1
449             <<: *job-linux-xl
450
451           - name: x86_64-gnu-nopt
452             <<: *job-linux-xl
453
454           - name: x86_64-gnu-tools
455             env:
456               DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
457             <<: *job-linux-xl
458
459           ####################
460           #  macOS Builders  #
461           ####################
462
463           - name: dist-x86_64-apple
464             env:
465               SCRIPT: ./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin
466               RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
467               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
468               MACOSX_DEPLOYMENT_TARGET: 10.7
469               NO_LLVM_ASSERTIONS: 1
470               NO_DEBUG_ASSERTIONS: 1
471               NO_OVERFLOW_CHECKS: 1
472               DIST_REQUIRE_ALL_TOOLS: 1
473             <<: *job-macos-xl
474
475           - name: dist-apple-various
476             env:
477               SCRIPT: ./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
478               RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
479               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
480               MACOSX_DEPLOYMENT_TARGET: 10.7
481               NO_LLVM_ASSERTIONS: 1
482               NO_DEBUG_ASSERTIONS: 1
483               NO_OVERFLOW_CHECKS: 1
484             <<: *job-macos-xl
485
486           - name: dist-x86_64-apple-alt
487             env:
488               SCRIPT: ./x.py dist bootstrap --include-default-paths
489               RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false
490               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
491               MACOSX_DEPLOYMENT_TARGET: 10.7
492               NO_LLVM_ASSERTIONS: 1
493               NO_DEBUG_ASSERTIONS: 1
494               NO_OVERFLOW_CHECKS: 1
495             <<: *job-macos-xl
496
497           - name: x86_64-apple-1
498             env: &env-x86_64-apple-tests
499               SCRIPT: ./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps
500               RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
501               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
502               MACOSX_DEPLOYMENT_TARGET: 10.8
503               MACOSX_STD_DEPLOYMENT_TARGET: 10.7
504               NO_LLVM_ASSERTIONS: 1
505               NO_DEBUG_ASSERTIONS: 1
506               NO_OVERFLOW_CHECKS: 1
507             <<: *job-macos-xl
508
509           - name: x86_64-apple-2
510             env:
511               SCRIPT: ./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps
512               <<: *env-x86_64-apple-tests
513             <<: *job-macos-xl
514
515           # This target only needs to support 11.0 and up as nothing else supports the hardware
516           - name: dist-aarch64-apple
517             env:
518               SCRIPT: ./x.py dist bootstrap --include-default-paths --stage 2
519               RUST_CONFIGURE_ARGS: >-
520                 --build=x86_64-apple-darwin
521                 --host=aarch64-apple-darwin
522                 --target=aarch64-apple-darwin
523                 --enable-full-tools
524                 --enable-sanitizers
525                 --enable-profiler
526                 --disable-docs
527                 --set rust.jemalloc
528                 --set llvm.ninja=false
529               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
530               USE_XCODE_CLANG: 1
531               MACOSX_DEPLOYMENT_TARGET: 11.0
532               MACOSX_STD_DEPLOYMENT_TARGET: 11.0
533               NO_LLVM_ASSERTIONS: 1
534               NO_DEBUG_ASSERTIONS: 1
535               NO_OVERFLOW_CHECKS: 1
536               DIST_REQUIRE_ALL_TOOLS: 1
537               # Corresponds to 16K page size
538               #
539               # Shouldn't be needed if jemalloc-sys is updated to
540               # handle this platform like iOS or if we build on
541               # aarch64-apple-darwin itself.
542               #
543               # https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237
544               JEMALLOC_SYS_WITH_LG_PAGE: 14
545             <<: *job-macos-xl
546
547           ######################
548           #  Windows Builders  #
549           ######################
550
551           - name: x86_64-msvc-1
552             env:
553               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
554               SCRIPT: make ci-subset-1
555             <<: *job-windows-xl
556
557           - name: x86_64-msvc-2
558             env:
559               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
560               SCRIPT: make ci-subset-2
561             <<: *job-windows-xl
562
563           - name: i686-msvc-1
564             env:
565               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
566               SCRIPT: make ci-subset-1
567             <<: *job-windows-xl
568
569           - name: i686-msvc-2
570             env:
571               RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
572               SCRIPT: make ci-subset-2
573             <<: *job-windows-xl
574
575           - name: x86_64-msvc-cargo
576             env:
577               SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo
578               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-lld
579             <<: *job-windows-xl
580
581           - name: x86_64-msvc-tools
582             env:
583               SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
584               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
585               DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
586             <<: *job-windows-xl
587
588           # 32/64-bit MinGW builds.
589           #
590           # We are using MinGW with POSIX threads since LLVM requires
591           # C++'s std::thread which is disabled in libstdc++ with win32 threads.
592           # FIXME: Libc++ doesn't have this limitation so we can avoid
593           # winpthreads if we switch to it.
594           #
595           # Instead of relying on the MinGW version installed on CI we download
596           # and install one ourselves so we won't be surprised by changes to CI's
597           # build image.
598           #
599           # Finally, note that the downloads below are all in the `rust-lang-ci` S3
600           # bucket, but they clearly didn't originate there! The downloads originally
601           # came from the mingw-w64 SourceForge download site. Unfortunately
602           # SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
603
604           - name: i686-mingw-1
605             env:
606               RUST_CONFIGURE_ARGS: >-
607                 --build=i686-pc-windows-gnu
608                 --set llvm.allow-old-toolchain
609               SCRIPT: make ci-mingw-subset-1
610               # We are intentionally allowing an old toolchain on this builder (and that's
611               # incompatible with LLVM downloads today).
612               NO_DOWNLOAD_CI_LLVM: 1
613               CUSTOM_MINGW: 1
614             <<: *job-windows-xl
615
616           - name: i686-mingw-2
617             env:
618               RUST_CONFIGURE_ARGS: >-
619                 --build=i686-pc-windows-gnu
620                 --set llvm.allow-old-toolchain
621               SCRIPT: make ci-mingw-subset-2
622               # We are intentionally allowing an old toolchain on this builder (and that's
623               # incompatible with LLVM downloads today).
624               NO_DOWNLOAD_CI_LLVM: 1
625               CUSTOM_MINGW: 1
626             <<: *job-windows-xl
627
628           - name: x86_64-mingw-1
629             env:
630               SCRIPT: make ci-mingw-subset-1
631               RUST_CONFIGURE_ARGS: >-
632                 --build=x86_64-pc-windows-gnu
633                 --enable-profiler
634                 --set llvm.allow-old-toolchain
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: x86_64-mingw-2
642             env:
643               SCRIPT: make ci-mingw-subset-2
644               RUST_CONFIGURE_ARGS: >-
645                 --build=x86_64-pc-windows-gnu
646                 --enable-profiler
647                 --set llvm.allow-old-toolchain
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: dist-x86_64-msvc
655             env:
656               RUST_CONFIGURE_ARGS: >-
657                 --build=x86_64-pc-windows-msvc
658                 --host=x86_64-pc-windows-msvc
659                 --target=x86_64-pc-windows-msvc
660                 --enable-full-tools
661                 --enable-profiler
662               SCRIPT: PGO_HOST=x86_64-pc-windows-msvc src/ci/pgo.sh python x.py dist bootstrap --include-default-paths
663               DIST_REQUIRE_ALL_TOOLS: 1
664             <<: *job-windows-xl
665
666           - name: dist-i686-msvc
667             env:
668               RUST_CONFIGURE_ARGS: >-
669                 --build=i686-pc-windows-msvc
670                 --host=i686-pc-windows-msvc
671                 --target=i686-pc-windows-msvc,i586-pc-windows-msvc
672                 --enable-full-tools
673                 --enable-profiler
674               SCRIPT: python x.py dist bootstrap --include-default-paths
675               DIST_REQUIRE_ALL_TOOLS: 1
676             <<: *job-windows-xl
677
678           - name: dist-aarch64-msvc
679             env:
680               RUST_CONFIGURE_ARGS: >-
681                 --build=x86_64-pc-windows-msvc
682                 --host=aarch64-pc-windows-msvc
683                 --enable-full-tools
684                 --enable-profiler
685               SCRIPT: python x.py dist bootstrap --include-default-paths
686               DIST_REQUIRE_ALL_TOOLS: 1
687               # Hack around this SDK version, because it doesn't work with clang.
688               # See https://github.com/rust-lang/rust/issues/88796
689               WINDOWS_SDK_20348_HACK: 1
690             <<: *job-windows-xl
691
692           - name: dist-i686-mingw
693             env:
694               RUST_CONFIGURE_ARGS: >-
695                 --build=i686-pc-windows-gnu
696                 --enable-full-tools
697                 --enable-profiler
698                 --set llvm.allow-old-toolchain
699               # We are intentionally allowing an old toolchain on this builder (and that's
700               # incompatible with LLVM downloads today).
701               NO_DOWNLOAD_CI_LLVM: 1
702               SCRIPT: python x.py dist bootstrap --include-default-paths
703               CUSTOM_MINGW: 1
704               DIST_REQUIRE_ALL_TOOLS: 1
705             <<: *job-windows-xl
706
707           - name: dist-x86_64-mingw
708             env:
709               SCRIPT: python x.py dist bootstrap --include-default-paths
710               RUST_CONFIGURE_ARGS: >-
711                 --build=x86_64-pc-windows-gnu
712                 --enable-full-tools
713                 --enable-profiler
714                 --set llvm.allow-old-toolchain
715               # We are intentionally allowing an old toolchain on this builder (and that's
716               # incompatible with LLVM downloads today).
717               NO_DOWNLOAD_CI_LLVM: 1
718               CUSTOM_MINGW: 1
719               DIST_REQUIRE_ALL_TOOLS: 1
720             <<: *job-windows-xl
721
722           - name: dist-x86_64-msvc-alt
723             env:
724               RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
725               SCRIPT: python x.py dist bootstrap --include-default-paths
726             <<: *job-windows-xl
727
728   try:
729     permissions:
730       actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds
731     <<: *base-ci-job
732     name: try
733     env:
734       <<: [*shared-ci-variables, *prod-variables]
735     if: github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'
736     strategy:
737       matrix:
738         include:
739           - &dist-x86_64-linux
740             name: dist-x86_64-linux
741             <<: *job-linux-xl
742
743   master:
744     name: master
745     runs-on: ubuntu-latest
746     env:
747       <<: [*prod-variables]
748     if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'
749     steps:
750       - name: checkout the source code
751         uses: actions/checkout@v3
752         with:
753           fetch-depth: 2
754
755       - name: publish toolstate
756         run: src/ci/publish_toolstate.sh
757         shell: bash
758         env:
759           TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
760         <<: *step
761
762   # These jobs don't actually test anything, but they're used to tell bors the
763   # build completed, as there is no practical way to detect when a workflow is
764   # successful listening to webhooks only.
765   try-success:
766     needs: [try]
767     if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
768     <<: *base-success-job
769   try-failure:
770     needs: [try]
771     if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
772     <<: *base-failure-job
773   auto-success:
774     needs: [auto]
775     if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
776     <<: *base-success-job
777   auto-failure:
778     needs: [auto]
779     if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
780     <<: *base-failure-job