forked from rust-lang/rustup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
125 lines (112 loc) · 4.51 KB
/
.travis.yml
File metadata and controls
125 lines (112 loc) · 4.51 KB
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
matrix:
include:
- os: linux
env: TARGET=i686-unknown-linux-gnu BITS=32 CFLAGS=-m32 CXXFLAGS=-m32
dist: trusty
- os: linux
env: TARGET=x86_64-unknown-linux-gnu BITS=64
dist: trusty
- os: osx
env: TARGET=i686-apple-darwin BITS=32 MACOSX_DEPLOYMENT_TARGET=10.7
- os: osx
env: TARGET=x86_64-apple-darwin BITS=64 MACOSX_DEPLOYMENT_TARGET=10.7
git:
submodules: false
branches:
only:
- master
- new
sudo: required
services:
- docker
install:
# Set git user for pushing binaries
- git config --global user.email "diggsey@googlemail.com"
- git config --global user.name "Diggory Blake (via Travis CI)"
- git config --global push.default simple
# Download nightly rust
- mkdir -p ~/rust
- echo -e "\033[33;1mDownloading Rust\033[0m"
- curl -sL https://static.rust-lang.org/dist/rust-nightly-$TARGET.tar.gz | tar --strip-components=1 -C ~/rust -xzf -
# For linux, install required packages
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$BITS" == "32" ]; then
sudo dpkg --add-architecture i386;
sudo apt-get update;
sudo apt-get install -y
libc6-dev:i386 libstdc++6:i386 zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386
gcc-4.8 cpp-4.8 gcc-4.8-multilib gcc-multilib;
else
sudo apt-get update;
sudo apt-get install -y
libcurl4-openssl-dev libelf-dev libdw-dev binutils-dev libiberty-dev;
fi
fi
# Install nightly rust
- echo -e "\033[33;1mInstalling Rust\033[0m"
- sudo ~/rust/install.sh
script:
# Run linux builds in a docker container to improve portability of the resulting binaries
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
false;
docker run
--entrypoint bash
-u `id -u`:`id -g`
-v /usr/local:/usr/local:ro
-v `pwd`:/buildslave
-v $HOME:/home/rustbuild
-e HOME=/home/rustbuild
-e LD_LIBRARY_PATH=/usr/local/lib
-e OPENSSL_STATIC=1
-e OPENSSL_LIB_DIR=/rustroot/cargo$BITS/lib
-it alexcrichton/rust-slave-dist:2015-10-20b
-c "cargo build --release --verbose && cargo test --release -p multirust-dist --verbose && cargo test --release --verbose" || exit 1;
else
cargo build --release --verbose || exit 1;
cargo test --release -p multirust-dist --verbose || exit 1;
cargo test --release --verbose || exit 1;
fi
after_success:
# Install kcov dependencies
- if [ "$TARGET" == "x86_64-unknown-linux-gnu" ]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz;
tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && cmake .. && make;
sudo make install && cd ../..;
echo "Uploading coverage... $TRAVIS_JOB_ID";
find target/debug/deps/*-* -executable -exec kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov '{}' \;;
find target/debug/*-* -executable ! -name multirust-rs -exec kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov '{}' \;;
fi
# Compute sha-256 hashes of all build artifacts
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
find "target/release/" -maxdepth 1 -type f -exec sh -c 'shasum -a 256 -b "{}" | cut -d\ -f1 > "{}.sha256"' \;;
else
find "target/release/" -maxdepth 1 -type f -exec sh -c 'sha256sum -b "{}" | cut -d\ -f1 > "{}.sha256"' \;;
fi
# Build documentation and push release binaries
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
git config --global credential.helper store;
echo "https://${TOKEN}:x-oauth-basic@github.com" >> ~/.git-credentials;
if [ "$TRAVIS_BRANCH" == "master" ]; then
if [ "$TARGET" == "x86_64-unknown-linux-gnu" ]; then
cargo doc;
echo '<meta http-equiv=refresh content=0;url=multirust/index.html>' > target/doc/index.html;
sudo pip install ghp-import;
ghp-import -n target/doc;
git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages;
fi;
bin=./binaries/$TARGET;
else
bin=./binaries/$TRAVIS_BRANCH/$TARGET;
fi;
git submodule init;
git submodule update --depth 1 --remote;
mkdir -p "$bin";
rm $bin/*;
find "target/release/" -maxdepth 1 -type f -exec cp "{}" "$bin" \;;
git rev-parse HEAD > "$bin/commit.txt";
cd binaries;
git checkout master;
git add -A;
git commit -m "Auto-update $TRAVIS_BRANCH/$TARGET binaries (Travis CI)";
for i in {1..5}; do ./push-changes.sh && break; done;
fi