]> git.lizzy.rs Git - rust.git/blob - .azure-pipelines/steps/run.yml
ci: Favor SCRIPT instead of RUST_CHECK_TARGET
[rust.git] / .azure-pipelines / steps / run.yml
1 # FIXME(linux): need to configure core dumps, enable them, and then dump
2 # backtraces on failure from all core dumps:
3 #
4 # - bash: sudo apt install gdb
5 # - bash: sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern'
6 #
7 # Check travis config for `gdb --batch` command to print all crash logs
8
9 steps:
10
11 - checkout: self
12   fetchDepth: 2
13
14 - bash: printenv | sort
15   displayName: Show environment variables
16
17 - bash: |
18     set -e
19     df -h
20     du . | sort -nr | head -n100
21   displayName: Show disk usage
22   # FIXME: this hasn't been tested, but maybe it works on Windows? Should test!
23   condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
24
25 - template: install-sccache.yml
26 - template: install-clang.yml
27
28 # Install some dependencies needed to build LLDB/Clang, currently only needed
29 # during the `dist` target
30 - bash: |
31     set -e
32     brew update
33     brew install xz
34     brew install swig
35   displayName: Install build dependencies (OSX)
36   condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['SCRIPT'],'./x.py dist'))
37
38 # Switch to XCode 9.3 on OSX since it seems to be the last version that supports
39 # i686-apple-darwin. We'll eventually want to upgrade this and it will probably
40 # force us to drop i686-apple-darwin, but let's keep the wheels turning for now.
41 - bash: |
42     set -e
43     sudo xcode-select --switch /Applications/Xcode_9.3.app
44   displayName: Switch to Xcode 9.3 (OSX)
45   condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
46
47 - template: install-windows-build-deps.yml
48
49 # Looks like docker containers have IPv6 disabled by default, so let's turn it
50 # on since libstd tests require it
51 - bash: |
52     set -e
53     echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json
54     sudo service docker restart
55   displayName: Enable IPv6
56   condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
57
58 # Check out all our submodules, but more quickly than using git by using one of
59 # our custom scripts
60 - bash: |
61     set -e
62     mkdir -p $HOME/rustsrc
63     $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
64   condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
65   displayName: Check out submodules (Unix)
66 - script: |
67     if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
68     sh src/ci/init_repo.sh . /d/cache/rustsrc
69   condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
70   displayName: Check out submodules (Windows)
71
72 # Ensure the `aws` CLI is installed so we can deploy later on, cache docker
73 # images, etc.
74 - bash: |
75     set -e
76     sudo apt-get install -y python3-setuptools
77     pip3 install awscli --upgrade --user
78     echo "##vso[task.prependpath]$HOME/.local/bin"
79   displayName: Install awscli (Linux)
80   condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
81 - script: pip install awscli
82   displayName: Install awscli (non-Linux)
83   condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
84
85 # Configure our CI_JOB_NAME variable which log analyzers can use for the main
86 # step to see what's going on.
87 - bash: echo "##vso[task.setvariable variable=CI_JOB_NAME]$SYSTEM_JOBNAME"
88   displayName: Configure Job Name
89
90 # As a quick smoke check on the otherwise very fast mingw-check linux builder
91 # check our own internal scripts.
92 - bash: |
93     set -e
94     git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
95     cd rust-toolstate
96     python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
97     cd ..
98     rm -rf rust-toolstate
99   condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check'))
100   displayName: Verify the publish_toolstate script works
101
102 - bash: |
103     set -e
104     if [ "$IMAGE" = "" ]; then
105       src/ci/run.sh
106     else
107       src/ci/docker/run.sh $IMAGE
108     fi
109   #timeoutInMinutes: 180
110   timeoutInMinutes: 600
111   env:
112     CI: true
113     SRC: .
114     AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
115   displayName: Run build
116
117 # If we're a deploy builder, use the `aws` command to publish everything to our
118 # bucket.
119 - bash: |
120     set -e
121     if [ "$AGENT_OS" = "Linux" ]; then
122         rm -rf obj/build/dist/doc
123         upload_dir=obj/build/dist
124     else
125         rm -rf build/dist/doc
126         upload_dir=build/dist
127     fi
128     ls -la $upload_dir
129     deploy_dir=rustc-builds
130     if [ "$DEPLOY_ALT" == "1" ]; then
131         deploy_dir=rustc-builds-alt
132     fi
133     aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
134   env:
135     AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
136   condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
137   displayName: Upload artifacts