fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
5.5 KiB150 linesraw
1#####################################
2##    READ BEFORE CHANGING THIS    ##
3#####################################
4
5# We're in the process of evaluating GitHub Actions as a possible replacement
6# for Azure Pipelines, and at the moment the configuration is duplicated
7# between the two CI providers. Be sure to also change the configuration in
8# src/ci/github-actions when changing this file.
9
10#####################################
11
12# FIXME(linux): need to configure core dumps, enable them, and then dump
13# backtraces on failure from all core dumps:
14#
15# - bash: sudo apt install gdb
16# - bash: sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern'
17#
18# Check travis config for `gdb --batch` command to print all crash logs
19
20steps:
21
22# Configure our CI_JOB_NAME variable which log analyzers can use for the main
23# step to see what's going on.
24- bash: |
25    builder=$(echo $AGENT_JOBNAME | cut -d ' ' -f 2)
26    echo "##vso[task.setvariable variable=CI_JOB_NAME]$builder"
27  displayName: Configure Job Name
28
29# Disable automatic line ending conversion, which is enabled by default on
30# Azure's Windows image. Having the conversion enabled caused regressions both
31# in our test suite (it broke miri tests) and in the ecosystem, since we
32# started shipping install scripts with CRLF endings instead of the old LF.
33#
34# Note that we do this a couple times during the build as the PATH and current
35# user/directory change, e.g. when mingw is enabled.
36- bash: git config --global core.autocrlf false
37  displayName: "Disable git automatic line ending conversion"
38
39- checkout: self
40  fetchDepth: 2
41
42- bash: src/ci/scripts/setup-environment.sh
43  displayName: Setup environment
44
45- bash: src/ci/scripts/clean-disk.sh
46  displayName: Clean disk
47
48- bash: src/ci/scripts/should-skip-this.sh
49  displayName: Decide whether to run this job
50
51- bash: src/ci/scripts/collect-cpu-stats.sh
52  displayName: Collect CPU-usage statistics in the background
53
54- bash: src/ci/scripts/dump-environment.sh
55  displayName: Show the current environment
56
57- bash: src/ci/scripts/install-sccache.sh
58  displayName: Install sccache
59  condition: and(succeeded(), not(variables.SKIP_JOB))
60
61- bash: src/ci/scripts/install-clang.sh
62  displayName: Install clang
63  condition: and(succeeded(), not(variables.SKIP_JOB))
64
65- bash: src/ci/scripts/install-wix.sh
66  displayName: Install wix
67  condition: and(succeeded(), not(variables.SKIP_JOB))
68
69- bash: src/ci/scripts/install-innosetup.sh
70  displayName: Install InnoSetup
71  condition: and(succeeded(), not(variables.SKIP_JOB))
72
73- bash: src/ci/scripts/symlink-build-dir.sh
74  displayName: Ensure the build happens on a partition with enough space
75  condition: and(succeeded(), not(variables.SKIP_JOB))
76
77- bash: src/ci/scripts/disable-git-crlf-conversion.sh
78  displayName: "Disable git automatic line ending conversion (on C:/)"
79  condition: and(succeeded(), not(variables.SKIP_JOB))
80
81- bash: src/ci/scripts/install-msys2.sh
82  displayName: Install msys2
83  condition: and(succeeded(), not(variables.SKIP_JOB))
84
85- bash: src/ci/scripts/install-msys2-packages.sh
86  displayName: Install msys2 packages
87  condition: and(succeeded(), not(variables.SKIP_JOB))
88
89- bash: src/ci/scripts/install-mingw.sh
90  displayName: Install MinGW
91  condition: and(succeeded(), not(variables.SKIP_JOB))
92
93- bash: src/ci/scripts/install-ninja.sh
94  displayName: Install ninja
95  condition: and(succeeded(), not(variables.SKIP_JOB))
96
97- bash: src/ci/scripts/enable-docker-ipv6.sh
98  displayName: Enable IPv6 on Docker
99  condition: and(succeeded(), not(variables.SKIP_JOB))
100
101# Disable automatic line ending conversion (again). On Windows, when we're
102# installing dependencies, something switches the git configuration directory or
103# re-enables autocrlf. We've not tracked down the exact cause -- and there may
104# be multiple -- but this should ensure submodules are checked out with the
105# appropriate line endings.
106- bash: src/ci/scripts/disable-git-crlf-conversion.sh
107  displayName: Disable git automatic line ending conversion
108  condition: and(succeeded(), not(variables.SKIP_JOB))
109
110- bash: src/ci/scripts/checkout-submodules.sh
111  displayName: Checkout submodules
112  condition: and(succeeded(), not(variables.SKIP_JOB))
113
114- bash: src/ci/scripts/verify-line-endings.sh
115  displayName: Verify line endings
116  condition: and(succeeded(), not(variables.SKIP_JOB))
117
118# Ensure the `aws` CLI is installed so we can deploy later on, cache docker
119# images, etc.
120- bash: src/ci/scripts/install-awscli.sh
121  condition: and(succeeded(), not(variables.SKIP_JOB))
122  displayName: Install awscli
123
124- bash: src/ci/scripts/run-build-from-ci.sh
125  timeoutInMinutes: 600
126  env:
127    AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
128    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
129    TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
130  condition: and(succeeded(), not(variables.SKIP_JOB))
131  displayName: Run build
132
133- bash: src/ci/scripts/upload-artifacts.sh
134  env:
135    AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID)
136    AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY)
137  displayName: Upload artifacts
138  # Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
139  # builders *should* have the AWS credentials available. Still, explicitly
140  # adding the condition is helpful as this way CI will not silently skip
141  # deploying artifacts from a dist builder if the variables are misconfigured,
142  # erroring about invalid credentials instead.
143  condition: |
144    and(
145      succeeded(), not(variables.SKIP_JOB),
146      or(
147        variables.UPLOAD_AWS_SECRET_ACCESS_KEY,
148        eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')
149      )
150    )