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