-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
93 lines (93 loc) · 3.3 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
language: rust
sudo: false
dist: trusty
rust: nightly
cache:
cargo: true
directories:
- $HOME/openssl
matrix:
include:
- env: TARGET=x86_64-unknown-linux-gnu TARGET_DESC=linux-x86_64
- env: TARGET=i686-unknown-linux-gnu TARGET_DESC=linux-i686 BUILD_OPENSSL_VERSION=1.0.2k
addons:
apt:
packages:
- gcc-multilib
- g++-multilib
- g++-4.8-multilib
# - env: TARGET=x86_64-unknown-linux-gnu TEST_ONLY=true
# - env: TARGET=i686-unknown-linux-musl DEPLOY_ONLY=true TARGET_DESC=linux-i686
# - env: TARGET=x86_64-unknown-linux-musl DEPLOY_ONLY=true TARGET_DESC=linux-x86_64
# - env: TARGET=i686-apple-darwin DEPLOY_ONLY=true TARGET_DESC=apple-i686
# os: osx
- env: TARGET=x86_64-apple-darwin TARGET_DESC=apple-x86_64
os: osx
before_script:
- |
# set RUN_TEST
if [[ (($TEST_ONLY = true || -z $DEPLOY_ONLY) && -z $TRAVIS_TAG) ]]; then
RUN_TEST=true
echo "tests enabled"
else
RUN_TEST=false
fi
- |
# set RUN_DEPLOY
if [[ ($DEPLOY_ONLY = true || -z $TEST_ONLY) && -n $TRAVIS_TAG ]]; then
RUN_DEPLOY=true
echo "deploy enabled"
else
RUN_DEPLOY=false
fi
- export PATH="$PATH:$HOME/.cargo/bin"
- |
# install target toolchain
if $RUN_TEST || $RUN_DEPLOY; then
rustup target add "$TARGET" || true
fi
- c++ --version
- |
# build openssl
if [ -n "$BUILD_OPENSSL_VERSION" ]; then
echo "building openssl"
./scripts/build.sh
fi
- |
# set openssl configuration
if [ -n "${BUILD_OPENSSL_VERSION}" -a -d "$HOME/openssl/lib" ]; then
echo "Building using openssl-${BUILD_OPENSSL_VERSION}"
export OPENSSL_DIR="${HOME}/openssl"
export LD_LIBRARY_PATH="${HOME}/openssl/lib:${LD_LIBRARY_PATH}"
export PATH="${HOME}/openssl/bin:${PATH}"
fi
script:
- |
# cargo build
if $RUN_TEST; then
cargo build --target "$TARGET" --verbose -j 1
fi
- |
# cargo test
if $RUN_TEST; then
cargo test --target "$TARGET" -p screeps-rs-network --verbose -j 1
cargo test --target "$TARGET" -p screeps-rs-ui --verbose -j 1
fi
- |
# cargo build --release
if $RUN_DEPLOY; then
cargo build --target "$TARGET" -p screeps-rs --verbose --release -j 1
fi
before_deploy:
- cargo build --target "$TARGET" --verbose --release -j 1
- tar -C "target/$TARGET/release/" -czf "${TRAVIS_TAG}-${TARGET_DESC}.tar.gz" "screeps-rs-client"
deploy:
provider: releases
api_key:
secure: rW0srqf05xxlzsgiH0+4HfycQQUWHWldBj5PKno+GpVXF/wPvAekHmhKzq41WC+/j7WpQnLMzI3LDMR9ZLnXjvv5UmOPeN/G90q8rHPocBHk9qTPA24CNNR5/aW26GuQygWhOwItkbdI41E9rQ6DmqnOehw/eVt6XcFax9Bs2X4loDOL6++QuH4IkloFyegQVJxGLCO4wUnKqjNej7dR+EJSlNgHXzpuRpAvpASvQAdf7gi23PFokuMn/sJrqkPArwDWsb1+XRlwVP9GZkOn6aRZxmlb9ijx8cJ3IyD/DqwMT8L8lxGL4qY57W6tL548x1fbEaiMMAEbCjjukXIMuOU1sxR0ZNkWLWVVBgISlAN1eOuFTMZOvexaF8eU5FvdLAKWbH5qWG02p01dNQmJr/1tdfQyWpmr4rskUGTqUNqa6owJQ7d1aTWt26Yo9ZDnun9YpyY1xg6upWU+wi+UVkX/4kSl9TX5HEmSMsJ8ybe4vYbS2KZKDJr5BcUzVORraPBEq0hibyiQNoRD8vaLwloSbvfRLAE2/rSbDtBk2TSwbP5/q/VlSqEN2saNgco8TSzzdDOYdUUETgSHBQO1VPe11NK4cZDF1cBWWQa31t3HpfCVXGG6gmRLkZn/vfCy5qJZNs38Dtq+fPHxZ+EJrPkydJP4v+9eftBHKkjNI0M=
file: "${TRAVIS_TAG}-${TARGET_DESC}.tar.gz"
on:
repo: daboross/screeps-rs
tags: true
condition: ("$DEPLOY_ONLY" = true || -z "$TEST_ONLY")
skip_cleanup: true