]> git.lizzy.rs Git - rust.git/blob - .github/workflows/ci.yml
Rollup merge of #91641 - dtolnay:cchar-if, r=Mark-Simulacrum
[rust.git] / .github / workflows / ci.yml
1 #############################################################
2 #   WARNING: automatically generated file, DO NOT CHANGE!   #
3 #############################################################
4
5 # This file was automatically generated by the expand-yaml-anchors tool. The
6 # source file that generated this one is:
7 #
8 #   src/ci/github-actions/ci.yml
9 #
10 # Once you make changes to that file you need to run:
11 #
12 #   ./x.py run src/tools/expand-yaml-anchors/
13 #
14 # The CI build will fail if the tool is not run after changes to this file.
15
16 ---
17 name: CI
18 "on":
19   push:
20     branches:
21       - auto
22       - try
23       - try-perf
24       - master
25   pull_request:
26     branches:
27       - "**"
28 defaults:
29   run:
30     shell: bash
31 jobs:
32   pr:
33     name: PR
34     env:
35       CI_JOB_NAME: "${{ matrix.name }}"
36       SCCACHE_BUCKET: rust-lang-ci-sccache2
37       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
38       CACHE_DOMAIN: ci-caches.rust-lang.org
39     if: "github.event_name == 'pull_request'"
40     strategy:
41       matrix:
42         include:
43           - name: mingw-check
44             os: ubuntu-20.04-xl
45             env: {}
46           - name: x86_64-gnu-llvm-12
47             os: ubuntu-20.04-xl
48             env: {}
49           - name: x86_64-gnu-tools
50             env:
51               CI_ONLY_WHEN_SUBMODULES_CHANGED: 1
52             os: ubuntu-20.04-xl
53     timeout-minutes: 600
54     runs-on: "${{ matrix.os }}"
55     steps:
56       - name: disable git crlf conversion
57         run: git config --global core.autocrlf false
58       - name: checkout the source code
59         uses: actions/checkout@v2
60         with:
61           fetch-depth: 2
62       - name: configure the PR in which the error message will be posted
63         run: "echo \"[CI_PR_NUMBER=$num]\""
64         env:
65           num: "${{ github.event.number }}"
66         if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
67       - name: add extra environment variables
68         run: src/ci/scripts/setup-environment.sh
69         env:
70           EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
71         if: success() && !env.SKIP_JOB
72       - name: decide whether to skip this job
73         run: src/ci/scripts/should-skip-this.sh
74         if: success() && !env.SKIP_JOB
75       - name: ensure the channel matches the target branch
76         run: src/ci/scripts/verify-channel.sh
77         if: success() && !env.SKIP_JOB
78       - name: configure GitHub Actions to kill the build when outdated
79         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
80         with:
81           github_token: "${{ secrets.github_token }}"
82         if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
83       - name: collect CPU statistics
84         run: src/ci/scripts/collect-cpu-stats.sh
85         if: success() && !env.SKIP_JOB
86       - name: show the current environment
87         run: src/ci/scripts/dump-environment.sh
88         if: success() && !env.SKIP_JOB
89       - name: install awscli
90         run: src/ci/scripts/install-awscli.sh
91         if: success() && !env.SKIP_JOB
92       - name: install sccache
93         run: src/ci/scripts/install-sccache.sh
94         if: success() && !env.SKIP_JOB
95       - name: install clang
96         run: src/ci/scripts/install-clang.sh
97         if: success() && !env.SKIP_JOB
98       - name: install WIX
99         run: src/ci/scripts/install-wix.sh
100         if: success() && !env.SKIP_JOB
101       - name: ensure the build happens on a partition with enough space
102         run: src/ci/scripts/symlink-build-dir.sh
103         if: success() && !env.SKIP_JOB
104       - name: disable git crlf conversion
105         run: src/ci/scripts/disable-git-crlf-conversion.sh
106         if: success() && !env.SKIP_JOB
107       - name: install MSYS2
108         run: src/ci/scripts/install-msys2.sh
109         if: success() && !env.SKIP_JOB
110       - name: install MinGW
111         run: src/ci/scripts/install-mingw.sh
112         if: success() && !env.SKIP_JOB
113       - name: install ninja
114         run: src/ci/scripts/install-ninja.sh
115         if: success() && !env.SKIP_JOB
116       - name: enable ipv6 on Docker
117         run: src/ci/scripts/enable-docker-ipv6.sh
118         if: success() && !env.SKIP_JOB
119       - name: disable git crlf conversion
120         run: src/ci/scripts/disable-git-crlf-conversion.sh
121         if: success() && !env.SKIP_JOB
122       - name: checkout submodules
123         run: src/ci/scripts/checkout-submodules.sh
124         if: success() && !env.SKIP_JOB
125       - name: ensure line endings are correct
126         run: src/ci/scripts/verify-line-endings.sh
127         if: success() && !env.SKIP_JOB
128       - name: ensure backported commits are in upstream branches
129         run: src/ci/scripts/verify-backported-commits.sh
130         if: success() && !env.SKIP_JOB
131       - name: ensure the stable version number is correct
132         run: src/ci/scripts/verify-stable-version-number.sh
133         if: success() && !env.SKIP_JOB
134       - name: run the build
135         run: src/ci/scripts/run-build-from-ci.sh
136         env:
137           AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
138           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
139           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
140         if: success() && !env.SKIP_JOB
141       - name: upload artifacts to S3
142         run: src/ci/scripts/upload-artifacts.sh
143         env:
144           AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
145           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
146         if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
147   auto:
148     name: auto
149     env:
150       CI_JOB_NAME: "${{ matrix.name }}"
151       SCCACHE_BUCKET: rust-lang-ci-sccache2
152       DEPLOY_BUCKET: rust-lang-ci2
153       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
154       TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
155       TOOLSTATE_PUBLISH: 1
156       CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
157       ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
158       CACHE_DOMAIN: ci-caches.rust-lang.org
159     if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
160     strategy:
161       matrix:
162         include:
163           - name: aarch64-gnu
164             os:
165               - self-hosted
166               - ARM64
167               - linux
168           - name: arm-android
169             os: ubuntu-20.04-xl
170             env: {}
171           - name: armhf-gnu
172             os: ubuntu-20.04-xl
173             env: {}
174           - name: dist-aarch64-linux
175             os: ubuntu-20.04-xl
176             env: {}
177           - name: dist-android
178             os: ubuntu-20.04-xl
179             env: {}
180           - name: dist-arm-linux
181             os: ubuntu-20.04-xl
182             env: {}
183           - name: dist-armhf-linux
184             os: ubuntu-20.04-xl
185             env: {}
186           - name: dist-armv7-linux
187             os: ubuntu-20.04-xl
188             env: {}
189           - name: dist-i586-gnu-i586-i686-musl
190             os: ubuntu-20.04-xl
191             env: {}
192           - name: dist-i686-linux
193             os: ubuntu-20.04-xl
194             env: {}
195           - name: dist-mips-linux
196             os: ubuntu-20.04-xl
197             env: {}
198           - name: dist-mips64-linux
199             os: ubuntu-20.04-xl
200             env: {}
201           - name: dist-mips64el-linux
202             os: ubuntu-20.04-xl
203             env: {}
204           - name: dist-mipsel-linux
205             os: ubuntu-20.04-xl
206             env: {}
207           - name: dist-powerpc-linux
208             os: ubuntu-20.04-xl
209             env: {}
210           - name: dist-powerpc64-linux
211             os: ubuntu-20.04-xl
212             env: {}
213           - name: dist-powerpc64le-linux
214             os: ubuntu-20.04-xl
215             env: {}
216           - name: dist-riscv64-linux
217             os: ubuntu-20.04-xl
218             env: {}
219           - name: dist-s390x-linux
220             os: ubuntu-20.04-xl
221             env: {}
222           - name: dist-various-1
223             os: ubuntu-20.04-xl
224             env: {}
225           - name: dist-various-2
226             os: ubuntu-20.04-xl
227             env: {}
228           - name: dist-x86_64-freebsd
229             os: ubuntu-20.04-xl
230             env: {}
231           - name: dist-x86_64-illumos
232             os: ubuntu-20.04-xl
233             env: {}
234           - name: dist-x86_64-linux
235             os: ubuntu-20.04-xl
236             env: {}
237           - name: dist-x86_64-linux-alt
238             env:
239               IMAGE: dist-x86_64-linux
240             os: ubuntu-20.04-xl
241           - name: dist-x86_64-musl
242             os: ubuntu-20.04-xl
243             env: {}
244           - name: dist-x86_64-netbsd
245             os: ubuntu-20.04-xl
246             env: {}
247           - name: i686-gnu
248             os: ubuntu-20.04-xl
249             env: {}
250           - name: i686-gnu-nopt
251             os: ubuntu-20.04-xl
252             env: {}
253           - name: mingw-check
254             os: ubuntu-20.04-xl
255             env: {}
256           - name: test-various
257             os: ubuntu-20.04-xl
258             env: {}
259           - name: wasm32
260             os: ubuntu-20.04-xl
261             env: {}
262           - name: x86_64-gnu
263             os: ubuntu-20.04-xl
264             env: {}
265           - name: x86_64-gnu-stable
266             env:
267               IMAGE: x86_64-gnu
268               RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
269               CI_ONLY_WHEN_CHANNEL: nightly
270             os: ubuntu-20.04-xl
271           - name: x86_64-gnu-aux
272             os: ubuntu-20.04-xl
273             env: {}
274           - name: x86_64-gnu-debug
275             os: ubuntu-20.04-xl
276             env: {}
277           - name: x86_64-gnu-distcheck
278             os: ubuntu-20.04-xl
279             env: {}
280           - name: x86_64-gnu-llvm-12
281             env:
282               RUST_BACKTRACE: 1
283             os: ubuntu-20.04-xl
284           - name: x86_64-gnu-nopt
285             os: ubuntu-20.04-xl
286             env: {}
287           - name: x86_64-gnu-tools
288             env:
289               DEPLOY_TOOLSTATES_JSON: toolstates-linux.json
290             os: ubuntu-20.04-xl
291           - name: dist-x86_64-apple
292             env:
293               SCRIPT: "./x.py dist --exclude rust-docs --exclude extended && ./x.py dist --target=x86_64-apple-darwin rust-docs && ./x.py dist extended"
294               RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
295               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
296               MACOSX_DEPLOYMENT_TARGET: 10.7
297               NO_LLVM_ASSERTIONS: 1
298               NO_DEBUG_ASSERTIONS: 1
299               NO_OVERFLOW_CHECKS: 1
300               DIST_REQUIRE_ALL_TOOLS: 1
301             os: macos-latest
302           - name: dist-x86_64-apple-alt
303             env:
304               SCRIPT: "./x.py dist"
305               RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
306               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
307               MACOSX_DEPLOYMENT_TARGET: 10.7
308               NO_LLVM_ASSERTIONS: 1
309               NO_DEBUG_ASSERTIONS: 1
310               NO_OVERFLOW_CHECKS: 1
311             os: macos-latest
312           - name: x86_64-apple
313             env:
314               SCRIPT: "./x.py --stage 2 test"
315               RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
316               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
317               MACOSX_DEPLOYMENT_TARGET: 10.8
318               MACOSX_STD_DEPLOYMENT_TARGET: 10.7
319               NO_LLVM_ASSERTIONS: 1
320               NO_DEBUG_ASSERTIONS: 1
321               NO_OVERFLOW_CHECKS: 1
322             os: macos-latest
323           - name: dist-aarch64-apple
324             env:
325               SCRIPT: "./x.py dist --stage 2"
326               RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --disable-docs --set rust.jemalloc --set llvm.ninja=false"
327               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
328               USE_XCODE_CLANG: 1
329               MACOSX_DEPLOYMENT_TARGET: 11.0
330               MACOSX_STD_DEPLOYMENT_TARGET: 11.0
331               NO_LLVM_ASSERTIONS: 1
332               NO_DEBUG_ASSERTIONS: 1
333               NO_OVERFLOW_CHECKS: 1
334               DIST_REQUIRE_ALL_TOOLS: 1
335               JEMALLOC_SYS_WITH_LG_PAGE: 14
336             os: macos-latest
337           - name: x86_64-msvc-1
338             env:
339               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
340               SCRIPT: make ci-subset-1
341             os: windows-latest-xl
342           - name: x86_64-msvc-2
343             env:
344               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
345               SCRIPT: make ci-subset-2
346             os: windows-latest-xl
347           - name: i686-msvc-1
348             env:
349               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
350               SCRIPT: make ci-subset-1
351             os: windows-latest-xl
352           - name: i686-msvc-2
353             env:
354               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
355               SCRIPT: make ci-subset-2
356             os: windows-latest-xl
357           - name: x86_64-msvc-cargo
358             env:
359               SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo
360               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-lld"
361             os: windows-latest-xl
362           - name: x86_64-msvc-tools
363             env:
364               SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
365               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
366               DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
367             os: windows-latest-xl
368           - name: i686-mingw-1
369             env:
370               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
371               SCRIPT: make ci-mingw-subset-1
372               CUSTOM_MINGW: 1
373             os: windows-latest-xl
374           - name: i686-mingw-2
375             env:
376               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
377               SCRIPT: make ci-mingw-subset-2
378               CUSTOM_MINGW: 1
379             os: windows-latest-xl
380           - name: x86_64-mingw-1
381             env:
382               SCRIPT: make ci-mingw-subset-1
383               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
384               CUSTOM_MINGW: 1
385             os: windows-latest-xl
386           - name: x86_64-mingw-2
387             env:
388               SCRIPT: make ci-mingw-subset-2
389               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
390               CUSTOM_MINGW: 1
391             os: windows-latest-xl
392           - name: dist-x86_64-msvc
393             env:
394               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler"
395               SCRIPT: python x.py dist
396               DIST_REQUIRE_ALL_TOOLS: 1
397             os: windows-latest-xl
398           - name: dist-i686-msvc
399             env:
400               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler"
401               SCRIPT: python x.py dist
402               DIST_REQUIRE_ALL_TOOLS: 1
403             os: windows-latest-xl
404           - name: dist-aarch64-msvc
405             env:
406               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=aarch64-pc-windows-msvc --enable-full-tools --enable-profiler"
407               SCRIPT: python x.py dist
408               DIST_REQUIRE_ALL_TOOLS: 0
409               WINDOWS_SDK_20348_HACK: 1
410             os: windows-latest-xl
411           - name: dist-i686-mingw
412             env:
413               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu --enable-full-tools --enable-profiler"
414               SCRIPT: python x.py dist
415               CUSTOM_MINGW: 1
416               DIST_REQUIRE_ALL_TOOLS: 1
417             os: windows-latest-xl
418           - name: dist-x86_64-mingw
419             env:
420               SCRIPT: python x.py dist
421               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-full-tools --enable-profiler"
422               CUSTOM_MINGW: 1
423               DIST_REQUIRE_ALL_TOOLS: 1
424             os: windows-latest-xl
425           - name: dist-x86_64-msvc-alt
426             env:
427               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-extended --enable-profiler"
428               SCRIPT: python x.py dist
429             os: windows-latest-xl
430     timeout-minutes: 600
431     runs-on: "${{ matrix.os }}"
432     steps:
433       - name: disable git crlf conversion
434         run: git config --global core.autocrlf false
435       - name: checkout the source code
436         uses: actions/checkout@v2
437         with:
438           fetch-depth: 2
439       - name: configure the PR in which the error message will be posted
440         run: "echo \"[CI_PR_NUMBER=$num]\""
441         env:
442           num: "${{ github.event.number }}"
443         if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
444       - name: add extra environment variables
445         run: src/ci/scripts/setup-environment.sh
446         env:
447           EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
448         if: success() && !env.SKIP_JOB
449       - name: decide whether to skip this job
450         run: src/ci/scripts/should-skip-this.sh
451         if: success() && !env.SKIP_JOB
452       - name: ensure the channel matches the target branch
453         run: src/ci/scripts/verify-channel.sh
454         if: success() && !env.SKIP_JOB
455       - name: configure GitHub Actions to kill the build when outdated
456         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
457         with:
458           github_token: "${{ secrets.github_token }}"
459         if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
460       - name: collect CPU statistics
461         run: src/ci/scripts/collect-cpu-stats.sh
462         if: success() && !env.SKIP_JOB
463       - name: show the current environment
464         run: src/ci/scripts/dump-environment.sh
465         if: success() && !env.SKIP_JOB
466       - name: install awscli
467         run: src/ci/scripts/install-awscli.sh
468         if: success() && !env.SKIP_JOB
469       - name: install sccache
470         run: src/ci/scripts/install-sccache.sh
471         if: success() && !env.SKIP_JOB
472       - name: install clang
473         run: src/ci/scripts/install-clang.sh
474         if: success() && !env.SKIP_JOB
475       - name: install WIX
476         run: src/ci/scripts/install-wix.sh
477         if: success() && !env.SKIP_JOB
478       - name: ensure the build happens on a partition with enough space
479         run: src/ci/scripts/symlink-build-dir.sh
480         if: success() && !env.SKIP_JOB
481       - name: disable git crlf conversion
482         run: src/ci/scripts/disable-git-crlf-conversion.sh
483         if: success() && !env.SKIP_JOB
484       - name: install MSYS2
485         run: src/ci/scripts/install-msys2.sh
486         if: success() && !env.SKIP_JOB
487       - name: install MinGW
488         run: src/ci/scripts/install-mingw.sh
489         if: success() && !env.SKIP_JOB
490       - name: install ninja
491         run: src/ci/scripts/install-ninja.sh
492         if: success() && !env.SKIP_JOB
493       - name: enable ipv6 on Docker
494         run: src/ci/scripts/enable-docker-ipv6.sh
495         if: success() && !env.SKIP_JOB
496       - name: disable git crlf conversion
497         run: src/ci/scripts/disable-git-crlf-conversion.sh
498         if: success() && !env.SKIP_JOB
499       - name: checkout submodules
500         run: src/ci/scripts/checkout-submodules.sh
501         if: success() && !env.SKIP_JOB
502       - name: ensure line endings are correct
503         run: src/ci/scripts/verify-line-endings.sh
504         if: success() && !env.SKIP_JOB
505       - name: ensure backported commits are in upstream branches
506         run: src/ci/scripts/verify-backported-commits.sh
507         if: success() && !env.SKIP_JOB
508       - name: ensure the stable version number is correct
509         run: src/ci/scripts/verify-stable-version-number.sh
510         if: success() && !env.SKIP_JOB
511       - name: run the build
512         run: src/ci/scripts/run-build-from-ci.sh
513         env:
514           AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
515           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
516           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
517         if: success() && !env.SKIP_JOB
518       - name: upload artifacts to S3
519         run: src/ci/scripts/upload-artifacts.sh
520         env:
521           AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
522           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
523         if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
524   try:
525     name: try
526     env:
527       CI_JOB_NAME: "${{ matrix.name }}"
528       SCCACHE_BUCKET: rust-lang-ci-sccache2
529       DEPLOY_BUCKET: rust-lang-ci2
530       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
531       TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
532       TOOLSTATE_PUBLISH: 1
533       CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
534       ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
535       CACHE_DOMAIN: ci-caches.rust-lang.org
536     if: "github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
537     strategy:
538       matrix:
539         include:
540           - name: dist-x86_64-linux
541             os: ubuntu-20.04-xl
542             env: {}
543     timeout-minutes: 600
544     runs-on: "${{ matrix.os }}"
545     steps:
546       - name: disable git crlf conversion
547         run: git config --global core.autocrlf false
548       - name: checkout the source code
549         uses: actions/checkout@v2
550         with:
551           fetch-depth: 2
552       - name: configure the PR in which the error message will be posted
553         run: "echo \"[CI_PR_NUMBER=$num]\""
554         env:
555           num: "${{ github.event.number }}"
556         if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
557       - name: add extra environment variables
558         run: src/ci/scripts/setup-environment.sh
559         env:
560           EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
561         if: success() && !env.SKIP_JOB
562       - name: decide whether to skip this job
563         run: src/ci/scripts/should-skip-this.sh
564         if: success() && !env.SKIP_JOB
565       - name: ensure the channel matches the target branch
566         run: src/ci/scripts/verify-channel.sh
567         if: success() && !env.SKIP_JOB
568       - name: configure GitHub Actions to kill the build when outdated
569         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
570         with:
571           github_token: "${{ secrets.github_token }}"
572         if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
573       - name: collect CPU statistics
574         run: src/ci/scripts/collect-cpu-stats.sh
575         if: success() && !env.SKIP_JOB
576       - name: show the current environment
577         run: src/ci/scripts/dump-environment.sh
578         if: success() && !env.SKIP_JOB
579       - name: install awscli
580         run: src/ci/scripts/install-awscli.sh
581         if: success() && !env.SKIP_JOB
582       - name: install sccache
583         run: src/ci/scripts/install-sccache.sh
584         if: success() && !env.SKIP_JOB
585       - name: install clang
586         run: src/ci/scripts/install-clang.sh
587         if: success() && !env.SKIP_JOB
588       - name: install WIX
589         run: src/ci/scripts/install-wix.sh
590         if: success() && !env.SKIP_JOB
591       - name: ensure the build happens on a partition with enough space
592         run: src/ci/scripts/symlink-build-dir.sh
593         if: success() && !env.SKIP_JOB
594       - name: disable git crlf conversion
595         run: src/ci/scripts/disable-git-crlf-conversion.sh
596         if: success() && !env.SKIP_JOB
597       - name: install MSYS2
598         run: src/ci/scripts/install-msys2.sh
599         if: success() && !env.SKIP_JOB
600       - name: install MinGW
601         run: src/ci/scripts/install-mingw.sh
602         if: success() && !env.SKIP_JOB
603       - name: install ninja
604         run: src/ci/scripts/install-ninja.sh
605         if: success() && !env.SKIP_JOB
606       - name: enable ipv6 on Docker
607         run: src/ci/scripts/enable-docker-ipv6.sh
608         if: success() && !env.SKIP_JOB
609       - name: disable git crlf conversion
610         run: src/ci/scripts/disable-git-crlf-conversion.sh
611         if: success() && !env.SKIP_JOB
612       - name: checkout submodules
613         run: src/ci/scripts/checkout-submodules.sh
614         if: success() && !env.SKIP_JOB
615       - name: ensure line endings are correct
616         run: src/ci/scripts/verify-line-endings.sh
617         if: success() && !env.SKIP_JOB
618       - name: ensure backported commits are in upstream branches
619         run: src/ci/scripts/verify-backported-commits.sh
620         if: success() && !env.SKIP_JOB
621       - name: ensure the stable version number is correct
622         run: src/ci/scripts/verify-stable-version-number.sh
623         if: success() && !env.SKIP_JOB
624       - name: run the build
625         run: src/ci/scripts/run-build-from-ci.sh
626         env:
627           AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
628           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
629           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
630         if: success() && !env.SKIP_JOB
631       - name: upload artifacts to S3
632         run: src/ci/scripts/upload-artifacts.sh
633         env:
634           AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
635           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
636         if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
637   master:
638     name: master
639     runs-on: ubuntu-latest
640     env:
641       SCCACHE_BUCKET: rust-lang-ci-sccache2
642       DEPLOY_BUCKET: rust-lang-ci2
643       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
644       TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
645       TOOLSTATE_PUBLISH: 1
646       CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
647       ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
648       CACHE_DOMAIN: ci-caches.rust-lang.org
649     if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
650     steps:
651       - name: checkout the source code
652         uses: actions/checkout@v2
653         with:
654           fetch-depth: 2
655       - name: publish toolstate
656         run: src/ci/publish_toolstate.sh
657         shell: bash
658         env:
659           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
660         if: success() && !env.SKIP_JOB
661   try-success:
662     needs:
663       - try
664     if: "success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
665     steps:
666       - name: mark the job as a success
667         run: exit 0
668         shell: bash
669     name: bors build finished
670     runs-on: ubuntu-latest
671   try-failure:
672     needs:
673       - try
674     if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
675     steps:
676       - name: mark the job as a failure
677         run: exit 1
678         shell: bash
679     name: bors build finished
680     runs-on: ubuntu-latest
681   auto-success:
682     needs:
683       - auto
684     if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
685     steps:
686       - name: mark the job as a success
687         run: exit 0
688         shell: bash
689     name: bors build finished
690     runs-on: ubuntu-latest
691   auto-failure:
692     needs:
693       - auto
694     if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
695     steps:
696       - name: mark the job as a failure
697         run: exit 1
698         shell: bash
699     name: bors build finished
700     runs-on: ubuntu-latest