forked from gluon-lang/gluon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
128 lines (117 loc) · 3.52 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
language: rust
sudo: required
services: docker
cache:
directories:
- $HOME/.cargo
- $HOME/.cache/sccache
# bors setup
branches:
only:
- staging
- trying
# Build PRs
- master
# Build release tags
- /^v?\d+\.\d+(\.\d+)?(-\S*)?$/
matrix:
include:
- rust: nightly-2020-09-12
# - rust: beta
- rust: stable
env: ARCH=i686
- rust: stable
env:
- DEPLOY=1
- PUBLISH=1
- TARGET=x86_64-unknown-linux-gnu
- rust: nightly-2020-09-12
env: WASM=1
# Only for deployment
# - if: tag IS present
# env:
# - TARGET=x86_64-unknown-freebsd
# - DEPLOY=1
# - DISABLE_TESTS=1
- if: tag IS present
env:
- TARGET=x86_64-pc-windows-gnu
- DEPLOY=1
- if: tag IS present
env:
- TARGET=x86_64-apple-darwin
- DEPLOY=1
os: osx
os:
- linux
before_install:
- set -e
- rustup self update
install:
- export PATH="$HOME/bin:$PATH"
- mkdir -p $HOME/bin
- ./scripts/install_sccache.sh $TARGET
- sh scripts/install_cross.sh
- source ~/.cargo/env || true
- ./scripts/install_mdbook.sh $TARGET
env:
global:
- CRATE_NAME=gluon
- CARGO_INCREMENTAL=0 # Incremental compilation is slower and bloats the travis cache
- RUST_BACKTRACE=1
- RUSTC_WRAPPER=sccache
# A clean build seems to create ~300M
- SCCACHE_CACHE_SIZE=500M
script:
- >
if [ ! -z $TRAVIS_TAG ]; then
echo "Disabling tests for tagged builds as they timeout otherwise"
elif [ ! -z $DISABLE_TESTS ]; then
return
elif [[ -z ${WASM+set} ]]; then
mdbook build book
./scripts/travis.sh
if ! git diff-index HEAD --; then
echo "Detected changes in the source after running tests"
exit 1
fi
else
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown -p gluon_c-api
fi
- sccache -s
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/78796507a78a48a4b18e
on_success: change
on_failure: always
on_start: never
before_deploy:
# Only run deployment on git tags
- CURRENT_TAG=`git describe --exact-match --abbrev=0 --tags || true`
- >
if [[ $CURRENT_TAG != "" ]]; then
export GIT_HASH=$(git rev-parse HEAD)
sh scripts/before_deploy.sh
fi
before_cache:
- rm -rf /home/travis/.cargo/registry
deploy:
- provider: releases
api_key:
secure: ImhF+DkxyHyzDQ4SZZlATjgkrzr+yY1xwADxgO2B5Xi+C7AOllkPInSB/RL+C6tebQnxIEop7KU0N4svbIw6zuoDmOvkliP++U1gXDqvpggBT7AXM5ICcLKWUzTdh3XexhL5SUmtH+QvWRwFwcOoq6mic8rc6DSvTojB/NydyJCeHGvx5iSl5o/ZSqrnEjOF/yDMXADVNwQRZebzyXss+wtTfEbD7OZoJ9ihPugDES8EkmScwS/UCJfCfEqBf/AwDSaAxVpPB/2PF7J0bDIB1ORrwA4HUguJ/U5QuV4vea0hNhhIzzwfcsbPhPLARcLENZLirUk3iygbwSPCTNg+8yEz0MPJQVTj/T48cbKkn9rgZfWi3Bs9nyv22ZouKBFQooiQD6b7WhVGY8bA1Q39cTSLfrR9WrkiRS3x11QrNkwWUqvWHb+2u0KtovTnCt9Lxrx0j8WKMO5Onx6hLfGfH00puCNpV8keWqkzriSi7/ce4mBl8HTvFX22bKZ5uZAxX2mPodAtWoh8hgOGMZhjG2ODS1CEQBxWw5nCXkKQE1afaJOEjhzXmmSNzTnfWIFQGk6V9T9LF8u/PrSVmkQCgka/arlUQlKl+Fa8XUEx8DZEHptj2OdP86A2qiUOcsAmYF2z19kYziHYK3Ll1xDPoOSil6Eej5t+n/e37bmvTMY=
file_glob: true
file: target/$CRATE_NAME-$TRAVIS_TAG-$TARGET.*
skip_cleanup: true
on:
tags: true
repo: gluon-lang/gluon
condition: $DEPLOY = 1
after_deploy:
- CURRENT_TAG=`git describe --exact-match --abbrev=0 --tags || true`
- >
if [[ $CURRENT_TAG != "" ]] && [[ $TRAVIS_RUST_VERSION == "stable" ]] && [[ $PUBLISH == "1" ]]; then
cargo login $CRATES_IO_TOKEN
./scripts/publish.sh "${CURRENT_TAG}"
fi