forked from rust-lang/rustup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
152 lines (140 loc) · 5.27 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
dist: xenial
services:
- docker
language: minimal
git:
depth: false
quiet: true
cache:
directories:
- "$HOME/.cargo"
- "$HOME/.cache/sccache"
before_cache:
- rm -rf "$HOME/.cargo/registry"
matrix:
fast_finish: true
include:
# Linux builds use the `rust-slave-dist` image so we link them against a
# "super old glibc" to ensure that it runs on as many platforms as possible.
# These builds always run. PRs, master, staging, stable, etc.
- &linuxalways
os: linux
env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
# Most builds consuming this only run on the stable and staging branches
- &linuxstable
os: linux
env: TARGET=i686-unknown-linux-gnu
if: branch != master
# These builds run on non-pull-requests, so master, staging, stable...
- &linuxmaster
os: linux
env: SKIP_TESTS=1 TARGET=aarch64-unknown-linux-gnu
if: type != pull_request
# Cross builds happen in the `rust-slave-linux-cross` image to ensure that
# we use the right cross compilers for these targets. That image should
# bundle all the gcc cross compilers to enable us to build OpenSSL
# Builds which occur only on stable (and staging branches) take linuxstable
# Those which occur on master or any other branch (but not PRs) linuxmaster
# And those which run always (PRs, master, staging, etc) linuxalways
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-unknown-linux-gnueabi }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-unknown-linux-gnueabihf }
- { <<: *linuxalways, env: SKIP_TESTS=1 TARGET=armv7-unknown-linux-gnueabihf }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=x86_64-unknown-freebsd }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=powerpc-unknown-linux-gnu }
- { <<: *linuxmaster, env: SKIP_TESTS=1 TARGET=powerpc64-unknown-linux-gnu }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=powerpc64le-unknown-linux-gnu }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips-unknown-linux-gnu }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mipsel-unknown-linux-gnu }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips64-unknown-linux-gnuabi64 }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=mips64el-unknown-linux-gnuabi64 }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=s390x-unknown-linux-gnu }
- { <<: *linuxmaster, env: SKIP_TESTS=1 TARGET=x86_64-unknown-linux-musl }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=arm-linux-androideabi }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=armv7-linux-androideabi }
- { <<: *linuxalways, env: SKIP_TESTS=1 TARGET=aarch64-linux-android }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=i686-linux-android }
- { <<: *linuxstable, env: SKIP_TESTS=1 TARGET=x86_64-linux-android }
# On OSX we want to target 10.7 so we ensure that the appropriate
# environment variable is set to tell the linker what we want.
#
# TODO: figure out why `xcode9.3`, the first image with OSX 10.13, breaks.
# Unclear why!
- &mac
os: osx
osx_image: xcode9.2
if: type != pull_request
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=x86_64-apple-darwin NO_ADD=1
- <<: *mac
if: branch != master
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=i686-apple-darwin
- name: clippy/rustup-init.sh
language: minimal
install:
- |
sh ./rustup-init.sh --default-toolchain=beta -y;
. "$HOME"/.cargo/env;
rustup component add clippy;
script:
- cargo clippy --all --all-targets
- |
docker run \
--volume "$TRAVIS_BUILD_DIR":/checkout:ro \
--workdir /checkout \
--rm \
-it \
centos:6 \
sh ./ci/raw_init.sh;
before_deploy:
deploy:
- &windows
os: windows
env: TARGET=x86_64-pc-windows-msvc NO_ADD=1 EXE_EXT=.exe
services: nil
language: bash
install:
- sh rustup-init.sh --default-toolchain=stable -y
- |
if [ -r "$HOME/.cargo/env" ]; then
. "$HOME"/.cargo/env;
else
export PATH="$HOME/.cargo/bin:$PATH";
fi
- if [ -z "$NO_ADD" ]; then rustup target add "$TARGET"; fi
script:
- mkdir -p target/"$TARGET";
- |
case "$TARGET" in
*-linux-android*) DOCKER=android ;; # Android uses a local docker image
*-apple-darwin) ;;
*-pc-windows-*) ;;
*) DOCKER="$TARGET" ;;
esac
- |
if [ -n "$DOCKER" ]; then
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
else
sh ci/run.sh;
fi
# Check the formatting last because test failures are more interesting to have
# discovered for contributors lacking some platform access for testing beforehand
- |
if [ "${TARGET}" = x86_64-unknown-linux-gnu ]; then
shellcheck -s dash -e SC1090 -- rustup-init.sh ci/*.sh;
rustup component add rustfmt;
rustfmt -vV;
cargo fmt --all -- --check;
fi
before_deploy:
- sh ci/prepare-deploy-travis.sh
deploy:
- provider: s3
bucket: dev-static-rust-lang-org
skip_cleanup: true
local_dir: deploy
upload_dir: rustup
acl: public_read
region: us-west-1
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
on:
branch: stable