]> git.lizzy.rs Git - rust.git/blob - .azure-pipelines/steps/run.yml
Only execute conditional steps on success
[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 # Ensure the `aws` CLI is installed so we can deploy later on, cache docker
12 # images, etc.
13 - bash: |
14     set -e
15     sudo apt-get install -y python3-setuptools
16     pip3 install awscli --upgrade --user
17     echo "##vso[task.prependpath]$HOME/.local/bin"
18   displayName: Install awscli (Linux)
19   condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
20 - script: pip install awscli
21   displayName: Install awscli (non-Linux)
22   condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
23
24 - bash: aws s3 help
25 - bash: exit 1
26
27 - checkout: self
28   fetchDepth: 2
29
30 - bash: printenv | sort
31   displayName: Show environment variables
32
33 - bash: |
34     set -e
35     df -h
36     du . | sort -nr | head -n100
37   displayName: Show disk usage
38   # FIXME: this hasn't been tested, but maybe it works on Windows? Should test!
39   condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
40
41 - template: install-sccache.yml
42 - template: install-clang.yml
43
44 # Install some dependencies needed to build LLDB/Clang, currently only needed
45 # during the `dist` target
46 - bash: |
47     set -e
48     brew update
49     brew install xz
50     brew install swig
51   displayName: Install build dependencies (OSX)
52   condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
53
54 - template: install-windows-build-deps.yml
55
56 # Check out all our submodules, but more quickly than using git by using one of
57 # our custom scripts
58 - bash: |
59     set -e
60     mkdir -p $HOME/rustsrc
61     $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
62   condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
63   displayName: Check out submodules (Unix)
64 - script: |
65     if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
66     sh src/ci/init_repo.sh . /d/cache/rustsrc
67   condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
68   displayName: Check out submodules (Windows)
69
70 # Configure our CI_JOB_NAME variable which log analyzers can use for the main
71 # step to see what's going on.
72 - bash: echo "##vso[task.setvariable variable=CI_JOB_NAME]$SYSTEM_JOBNAME"
73   displayName: Configure Job Name
74
75 # As a quick smoke check on the otherwise very fast mingw-check linux builder
76 # check our own internal scripts.
77 - bash: |
78     set -e
79     git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
80     cd rust-toolstate
81     python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
82     cd ..
83     rm -rf rust-toolstate
84   condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check'))
85   displayName: Verify the publish_toolstate script works
86
87 - bash: |
88     set -e
89     if [ "$IMAGE" = "" ]; then
90       src/ci/run.sh
91     else
92       src/ci/docker/run.sh $IMAGE
93     fi
94   timeoutInMinutes: 180
95   env:
96     CI: true
97     SRC: .
98     AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
99   displayName: Run build
100
101 - bash: |
102     set -e
103     deploy_dir=rustc-builds
104     if [ "$DEPLOY_ALT" == "1" ]; then
105         deploy_dir=rustc-builds-alt
106     fi
107     aws s3 cp --no-progress --recursive --acl public-read ./deploy s3://$DEPLOY_BUCKET/$deploy_dir
108   env:
109     AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
110   condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
111   displayName: Upload artifacts