]> git.lizzy.rs Git - rust.git/blob - .azure-pipelines/steps/run.yml
ci: switch to xcode 9.3 on azure
[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['RUST_CHECK_TARGET'],'dist'))
37
38 - bash: |
39     set -e
40     sudo xcode-select --switch /Applications/Xcode_9.3.app
41   displayName: Switch to Xcode 9.3 (OSX)
42   condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
43
44 - template: install-windows-build-deps.yml
45
46 # Looks like docker containers have IPv6 disabled by default, so let's turn it
47 # on since libstd tests require it
48 - bash: |
49     set -e
50     echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json
51     sudo service docker restart
52   displayName: Enable IPv6
53   condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
54
55 # Check out all our submodules, but more quickly than using git by using one of
56 # our custom scripts
57 - bash: |
58     set -e
59     mkdir -p $HOME/rustsrc
60     $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
61   condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
62   displayName: Check out submodules (Unix)
63 - script: |
64     if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
65     sh src/ci/init_repo.sh . /d/cache/rustsrc
66   condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
67   displayName: Check out submodules (Windows)
68
69 # Ensure the `aws` CLI is installed so we can deploy later on, cache docker
70 # images, etc.
71 - bash: |
72     set -e
73     sudo apt-get install -y python3-setuptools
74     pip3 install awscli --upgrade --user
75     echo "##vso[task.prependpath]$HOME/.local/bin"
76   displayName: Install awscli (Linux)
77   condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
78 - script: pip install awscli
79   displayName: Install awscli (non-Linux)
80   condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
81
82 # Configure our CI_JOB_NAME variable which log analyzers can use for the main
83 # step to see what's going on.
84 - bash: echo "##vso[task.setvariable variable=CI_JOB_NAME]$SYSTEM_JOBNAME"
85   displayName: Configure Job Name
86
87 # As a quick smoke check on the otherwise very fast mingw-check linux builder
88 # check our own internal scripts.
89 - bash: |
90     set -e
91     git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
92     cd rust-toolstate
93     python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
94     cd ..
95     rm -rf rust-toolstate
96   condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check'))
97   displayName: Verify the publish_toolstate script works
98
99 - bash: |
100     set -e
101     if [ "$IMAGE" = "" ]; then
102       src/ci/run.sh
103     else
104       src/ci/docker/run.sh $IMAGE
105     fi
106   #timeoutInMinutes: 180
107   timeoutInMinutes: 600
108   env:
109     CI: true
110     SRC: .
111     AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
112   displayName: Run build
113
114 - bash: |
115     set -e
116     if [ "$AGENT_OS" = "Linux" ]; then
117         rm -rf obj/build/dist/doc
118         upload_dir=obj/build/dist deploy/$BUILD_SOURCEVERSION
119     else
120         rm -rf build/dist/doc
121         upload_dir=build/dist
122     fi
123     ls -la $upload_dir
124     deploy_dir=rustc-builds
125     if [ "$DEPLOY_ALT" == "1" ]; then
126         deploy_dir=rustc-builds-alt
127     fi
128     aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
129   env:
130     AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
131   condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
132   displayName: Upload artifacts