]> git.lizzy.rs Git - rust.git/blob - .github/workflows/ci.yml
Rollup merge of #93206 - ChrisDenton:ntopenfile, r=nagisa
[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 --host=x86_64-apple-darwin --target=x86_64-apple-darwin"
294               RUST_CONFIGURE_ARGS: "--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-apple-various
303             env:
304               SCRIPT: "./x.py dist --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
305               RUST_CONFIGURE_ARGS: "--enable-sanitizers --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: dist-x86_64-apple-alt
313             env:
314               SCRIPT: "./x.py dist"
315               RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
316               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
317               MACOSX_DEPLOYMENT_TARGET: 10.7
318               NO_LLVM_ASSERTIONS: 1
319               NO_DEBUG_ASSERTIONS: 1
320               NO_OVERFLOW_CHECKS: 1
321             os: macos-latest
322           - name: x86_64-apple
323             env:
324               SCRIPT: "./x.py --stage 2 test"
325               RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
326               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
327               MACOSX_DEPLOYMENT_TARGET: 10.8
328               MACOSX_STD_DEPLOYMENT_TARGET: 10.7
329               NO_LLVM_ASSERTIONS: 1
330               NO_DEBUG_ASSERTIONS: 1
331               NO_OVERFLOW_CHECKS: 1
332             os: macos-latest
333           - name: dist-aarch64-apple
334             env:
335               SCRIPT: "./x.py dist --stage 2"
336               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"
337               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
338               USE_XCODE_CLANG: 1
339               MACOSX_DEPLOYMENT_TARGET: 11.0
340               MACOSX_STD_DEPLOYMENT_TARGET: 11.0
341               NO_LLVM_ASSERTIONS: 1
342               NO_DEBUG_ASSERTIONS: 1
343               NO_OVERFLOW_CHECKS: 1
344               DIST_REQUIRE_ALL_TOOLS: 1
345               JEMALLOC_SYS_WITH_LG_PAGE: 14
346             os: macos-latest
347           - name: x86_64-msvc-1
348             env:
349               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
350               SCRIPT: make ci-subset-1
351             os: windows-latest-xl
352           - name: x86_64-msvc-2
353             env:
354               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
355               SCRIPT: make ci-subset-2
356             os: windows-latest-xl
357           - name: i686-msvc-1
358             env:
359               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
360               SCRIPT: make ci-subset-1
361             os: windows-latest-xl
362           - name: i686-msvc-2
363             env:
364               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
365               SCRIPT: make ci-subset-2
366             os: windows-latest-xl
367           - name: x86_64-msvc-cargo
368             env:
369               SCRIPT: python x.py --stage 2 test src/tools/cargotest src/tools/cargo
370               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-lld"
371             os: windows-latest-xl
372           - name: x86_64-msvc-tools
373             env:
374               SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
375               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
376               DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
377             os: windows-latest-xl
378           - name: i686-mingw-1
379             env:
380               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
381               SCRIPT: make ci-mingw-subset-1
382               CUSTOM_MINGW: 1
383             os: windows-latest-xl
384           - name: i686-mingw-2
385             env:
386               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
387               SCRIPT: make ci-mingw-subset-2
388               CUSTOM_MINGW: 1
389             os: windows-latest-xl
390           - name: x86_64-mingw-1
391             env:
392               SCRIPT: make ci-mingw-subset-1
393               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
394               CUSTOM_MINGW: 1
395             os: windows-latest-xl
396           - name: x86_64-mingw-2
397             env:
398               SCRIPT: make ci-mingw-subset-2
399               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
400               CUSTOM_MINGW: 1
401             os: windows-latest-xl
402           - name: dist-x86_64-msvc
403             env:
404               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"
405               SCRIPT: python x.py dist
406               DIST_REQUIRE_ALL_TOOLS: 1
407             os: windows-latest-xl
408           - name: dist-i686-msvc
409             env:
410               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"
411               SCRIPT: python x.py dist
412               DIST_REQUIRE_ALL_TOOLS: 1
413             os: windows-latest-xl
414           - name: dist-aarch64-msvc
415             env:
416               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=aarch64-pc-windows-msvc --enable-full-tools --enable-profiler"
417               SCRIPT: python x.py dist
418               DIST_REQUIRE_ALL_TOOLS: 0
419               WINDOWS_SDK_20348_HACK: 1
420             os: windows-latest-xl
421           - name: dist-i686-mingw
422             env:
423               RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu --enable-full-tools --enable-profiler"
424               SCRIPT: python x.py dist
425               CUSTOM_MINGW: 1
426               DIST_REQUIRE_ALL_TOOLS: 1
427             os: windows-latest-xl
428           - name: dist-x86_64-mingw
429             env:
430               SCRIPT: python x.py dist
431               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-full-tools --enable-profiler"
432               CUSTOM_MINGW: 1
433               DIST_REQUIRE_ALL_TOOLS: 1
434             os: windows-latest-xl
435           - name: dist-x86_64-msvc-alt
436             env:
437               RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-extended --enable-profiler"
438               SCRIPT: python x.py dist
439             os: windows-latest-xl
440     timeout-minutes: 600
441     runs-on: "${{ matrix.os }}"
442     steps:
443       - name: disable git crlf conversion
444         run: git config --global core.autocrlf false
445       - name: checkout the source code
446         uses: actions/checkout@v2
447         with:
448           fetch-depth: 2
449       - name: configure the PR in which the error message will be posted
450         run: "echo \"[CI_PR_NUMBER=$num]\""
451         env:
452           num: "${{ github.event.number }}"
453         if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
454       - name: add extra environment variables
455         run: src/ci/scripts/setup-environment.sh
456         env:
457           EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
458         if: success() && !env.SKIP_JOB
459       - name: decide whether to skip this job
460         run: src/ci/scripts/should-skip-this.sh
461         if: success() && !env.SKIP_JOB
462       - name: ensure the channel matches the target branch
463         run: src/ci/scripts/verify-channel.sh
464         if: success() && !env.SKIP_JOB
465       - name: configure GitHub Actions to kill the build when outdated
466         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
467         with:
468           github_token: "${{ secrets.github_token }}"
469         if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
470       - name: collect CPU statistics
471         run: src/ci/scripts/collect-cpu-stats.sh
472         if: success() && !env.SKIP_JOB
473       - name: show the current environment
474         run: src/ci/scripts/dump-environment.sh
475         if: success() && !env.SKIP_JOB
476       - name: install awscli
477         run: src/ci/scripts/install-awscli.sh
478         if: success() && !env.SKIP_JOB
479       - name: install sccache
480         run: src/ci/scripts/install-sccache.sh
481         if: success() && !env.SKIP_JOB
482       - name: install clang
483         run: src/ci/scripts/install-clang.sh
484         if: success() && !env.SKIP_JOB
485       - name: install WIX
486         run: src/ci/scripts/install-wix.sh
487         if: success() && !env.SKIP_JOB
488       - name: ensure the build happens on a partition with enough space
489         run: src/ci/scripts/symlink-build-dir.sh
490         if: success() && !env.SKIP_JOB
491       - name: disable git crlf conversion
492         run: src/ci/scripts/disable-git-crlf-conversion.sh
493         if: success() && !env.SKIP_JOB
494       - name: install MSYS2
495         run: src/ci/scripts/install-msys2.sh
496         if: success() && !env.SKIP_JOB
497       - name: install MinGW
498         run: src/ci/scripts/install-mingw.sh
499         if: success() && !env.SKIP_JOB
500       - name: install ninja
501         run: src/ci/scripts/install-ninja.sh
502         if: success() && !env.SKIP_JOB
503       - name: enable ipv6 on Docker
504         run: src/ci/scripts/enable-docker-ipv6.sh
505         if: success() && !env.SKIP_JOB
506       - name: disable git crlf conversion
507         run: src/ci/scripts/disable-git-crlf-conversion.sh
508         if: success() && !env.SKIP_JOB
509       - name: checkout submodules
510         run: src/ci/scripts/checkout-submodules.sh
511         if: success() && !env.SKIP_JOB
512       - name: ensure line endings are correct
513         run: src/ci/scripts/verify-line-endings.sh
514         if: success() && !env.SKIP_JOB
515       - name: ensure backported commits are in upstream branches
516         run: src/ci/scripts/verify-backported-commits.sh
517         if: success() && !env.SKIP_JOB
518       - name: ensure the stable version number is correct
519         run: src/ci/scripts/verify-stable-version-number.sh
520         if: success() && !env.SKIP_JOB
521       - name: run the build
522         run: src/ci/scripts/run-build-from-ci.sh
523         env:
524           AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
525           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
526           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
527         if: success() && !env.SKIP_JOB
528       - name: upload artifacts to S3
529         run: src/ci/scripts/upload-artifacts.sh
530         env:
531           AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
532           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
533         if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
534   try:
535     name: try
536     env:
537       CI_JOB_NAME: "${{ matrix.name }}"
538       SCCACHE_BUCKET: rust-lang-ci-sccache2
539       DEPLOY_BUCKET: rust-lang-ci2
540       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
541       TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
542       TOOLSTATE_PUBLISH: 1
543       CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
544       ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
545       CACHE_DOMAIN: ci-caches.rust-lang.org
546     if: "github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
547     strategy:
548       matrix:
549         include:
550           - name: dist-x86_64-linux
551             os: ubuntu-20.04-xl
552             env: {}
553     timeout-minutes: 600
554     runs-on: "${{ matrix.os }}"
555     steps:
556       - name: disable git crlf conversion
557         run: git config --global core.autocrlf false
558       - name: checkout the source code
559         uses: actions/checkout@v2
560         with:
561           fetch-depth: 2
562       - name: configure the PR in which the error message will be posted
563         run: "echo \"[CI_PR_NUMBER=$num]\""
564         env:
565           num: "${{ github.event.number }}"
566         if: "success() && !env.SKIP_JOB && github.event_name == 'pull_request'"
567       - name: add extra environment variables
568         run: src/ci/scripts/setup-environment.sh
569         env:
570           EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
571         if: success() && !env.SKIP_JOB
572       - name: decide whether to skip this job
573         run: src/ci/scripts/should-skip-this.sh
574         if: success() && !env.SKIP_JOB
575       - name: ensure the channel matches the target branch
576         run: src/ci/scripts/verify-channel.sh
577         if: success() && !env.SKIP_JOB
578       - name: configure GitHub Actions to kill the build when outdated
579         uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
580         with:
581           github_token: "${{ secrets.github_token }}"
582         if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
583       - name: collect CPU statistics
584         run: src/ci/scripts/collect-cpu-stats.sh
585         if: success() && !env.SKIP_JOB
586       - name: show the current environment
587         run: src/ci/scripts/dump-environment.sh
588         if: success() && !env.SKIP_JOB
589       - name: install awscli
590         run: src/ci/scripts/install-awscli.sh
591         if: success() && !env.SKIP_JOB
592       - name: install sccache
593         run: src/ci/scripts/install-sccache.sh
594         if: success() && !env.SKIP_JOB
595       - name: install clang
596         run: src/ci/scripts/install-clang.sh
597         if: success() && !env.SKIP_JOB
598       - name: install WIX
599         run: src/ci/scripts/install-wix.sh
600         if: success() && !env.SKIP_JOB
601       - name: ensure the build happens on a partition with enough space
602         run: src/ci/scripts/symlink-build-dir.sh
603         if: success() && !env.SKIP_JOB
604       - name: disable git crlf conversion
605         run: src/ci/scripts/disable-git-crlf-conversion.sh
606         if: success() && !env.SKIP_JOB
607       - name: install MSYS2
608         run: src/ci/scripts/install-msys2.sh
609         if: success() && !env.SKIP_JOB
610       - name: install MinGW
611         run: src/ci/scripts/install-mingw.sh
612         if: success() && !env.SKIP_JOB
613       - name: install ninja
614         run: src/ci/scripts/install-ninja.sh
615         if: success() && !env.SKIP_JOB
616       - name: enable ipv6 on Docker
617         run: src/ci/scripts/enable-docker-ipv6.sh
618         if: success() && !env.SKIP_JOB
619       - name: disable git crlf conversion
620         run: src/ci/scripts/disable-git-crlf-conversion.sh
621         if: success() && !env.SKIP_JOB
622       - name: checkout submodules
623         run: src/ci/scripts/checkout-submodules.sh
624         if: success() && !env.SKIP_JOB
625       - name: ensure line endings are correct
626         run: src/ci/scripts/verify-line-endings.sh
627         if: success() && !env.SKIP_JOB
628       - name: ensure backported commits are in upstream branches
629         run: src/ci/scripts/verify-backported-commits.sh
630         if: success() && !env.SKIP_JOB
631       - name: ensure the stable version number is correct
632         run: src/ci/scripts/verify-stable-version-number.sh
633         if: success() && !env.SKIP_JOB
634       - name: run the build
635         run: src/ci/scripts/run-build-from-ci.sh
636         env:
637           AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
638           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
639           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
640         if: success() && !env.SKIP_JOB
641       - name: upload artifacts to S3
642         run: src/ci/scripts/upload-artifacts.sh
643         env:
644           AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
645           AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
646         if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
647   master:
648     name: master
649     runs-on: ubuntu-latest
650     env:
651       SCCACHE_BUCKET: rust-lang-ci-sccache2
652       DEPLOY_BUCKET: rust-lang-ci2
653       TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
654       TOOLSTATE_ISSUES_API_URL: "https://api.github.com/repos/rust-lang/rust/issues"
655       TOOLSTATE_PUBLISH: 1
656       CACHES_AWS_ACCESS_KEY_ID: AKIA46X5W6CZI5DHEBFL
657       ARTIFACTS_AWS_ACCESS_KEY_ID: AKIA46X5W6CZN24CBO55
658       CACHE_DOMAIN: ci-caches.rust-lang.org
659     if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
660     steps:
661       - name: checkout the source code
662         uses: actions/checkout@v2
663         with:
664           fetch-depth: 2
665       - name: publish toolstate
666         run: src/ci/publish_toolstate.sh
667         shell: bash
668         env:
669           TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
670         if: success() && !env.SKIP_JOB
671   try-success:
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 success
677         run: exit 0
678         shell: bash
679     name: bors build finished
680     runs-on: ubuntu-latest
681   try-failure:
682     needs:
683       - try
684     if: "!success() && github.event_name == 'push' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust'"
685     steps:
686       - name: mark the job as a failure
687         run: exit 1
688         shell: bash
689     name: bors build finished
690     runs-on: ubuntu-latest
691   auto-success:
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 success
697         run: exit 0
698         shell: bash
699     name: bors build finished
700     runs-on: ubuntu-latest
701   auto-failure:
702     needs:
703       - auto
704     if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
705     steps:
706       - name: mark the job as a failure
707         run: exit 1
708         shell: bash
709     name: bors build finished
710     runs-on: ubuntu-latest