forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
120 lines (118 loc) · 3.72 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
language: node_js
node_js:
- "10"
branches:
# Only build master and tagged versions, i.e. not feature branches; feature
# branches already get built after opening a pull request.
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
env:
global:
- STACK_VERSION=2.1.1
matrix:
include:
# We use trusty boxes because they seem to be a bit faster.
- os: linux
dist: trusty
sudo: required
- os: osx
- os: windows
# Override the default stack root directory to ensure that it will be
# cached
env: STACK_ROOT=$HOME/.stack
# workaround for https://travis-ci.community/t/windows-instances-hanging-before-install/250/15
filter_secrets: false
addons:
apt:
packages:
- libgmp-dev
# Travis CI's build cache mechanism allows you to cache compiled artifacts in
# order to speed subsequent builds up; this is essential for us, because
# installing all of the compiler's Haskell dependencies can take longer than
# the allotted time for a single build.
#
# Unfortunately, if we allow a build to reach the Travis timeout limit, we
# don't get the opportunity to upload a cache (since uploading is included in
# the time limit, and we've already run out of time). Therefore, if we want
# the progress we have made in a build to be saved to the build cache, we need
# to make sure we abort the build early to allow time to upload the cache.
# Then, the next commit can pick up where the previous commit left off.
#
# If a CI build times out, you need to push a new commit. Amending and
# force-pushing DOES NOT WORK. I suspect this is because Travis will only
# consider a particular build cache to be appropriate to use when building a
# given commit with if the cache was created by a parent of the commit being
# built (which is sensible of them).
cache:
directories:
- $HOME/.stack
# Maximum amount of time in seconds spent attempting to upload a new cache
# before aborting. Since our cache can get rather large, increasing this
# value helps avoid situations where caches fail to be stored. The default
# value is 180 (at the time of writing).
timeout: 1000
install:
- |
if [ "$TRAVIS_OS_NAME" = "windows" ]
then
ci/disable-windows-defender.sh
fi
- mkdir -p "$HOME/.local/bin"
- export PATH="$PATH:$HOME/.local/bin"
- | # Install stack.
URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK_VERSION}/stack-${STACK_VERSION}-${TRAVIS_OS_NAME}-x86_64.tar.gz"
mkdir "$HOME/stack"
pushd "$HOME/stack"
curl --location "$URL" > stack.tar.gz
tar -xzf stack.tar.gz --strip-components=1
mv stack "$HOME/.local/bin/"
popd
- | # Install hlint.
BIN_DIR="$HOME/.local/bin/" BUILD_DIR="$HOME/hlint" ci/install-hlint.sh
- | # Set up the timeout command
if which timeout >/dev/null
then
TIMEOUT=timeout
elif [ "$TRAVIS_OS_NAME" == "osx" ]
then
if ! which gtimeout >/dev/null
then
brew update
brew install coreutils
fi
TIMEOUT=gtimeout
else
echo "Unable to set up timeout command"
exit 1
fi
- stack --version
- stack --no-terminal setup
- stack path
- npm install -g bower # for psc-docs / psc-publish tests
- export OS_NAME=$(./ci/convert-os-name.sh)
- |
if [ -n "$TRAVIS_TAG" ]
then
export CI_RELEASE=true
fi
script:
- hlint --git
# Set a timeout of 35 minutes. We could use travis_wait here, but travis_wait
# doesn't produce any output until the command finishes, and also doesn't
# always show all of the command's output.
- $TIMEOUT 35m ci/build.sh
before_deploy:
- pushd sdist-test
- bundle/build.sh $OS_NAME
- popd
deploy:
provider: releases
api_key: $RELEASE_KEY
file:
- sdist-test/bundle/$OS_NAME.tar.gz
- sdist-test/bundle/$OS_NAME.sha
skip_cleanup: true
on:
all_branches: true
tags: true