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