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