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