forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
139 lines (136 loc) · 4.16 KB
/
.travis.yml
File metadata and controls
139 lines (136 loc) · 4.16 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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*)?$/
matrix:
include:
# We use trusty boxes because they seem to be a bit faster.
- os: linux
dist: trusty
sudo: required
- os: osx
- os: windows
# Workaround for a Travis caching bug on Windows where absolute paths
# are not restored from caches properly:
# https://github.com/travis-ci/casher/pull/38
env: STACK_ROOT=$TRAVIS_BUILD_DIR/.stack_root
# workaround for https://travis-ci.community/t/windows-instances-hanging-before-install/250/15
filter_secrets: false
addons:
apt:
packages:
- libgmp-dev
cache:
# 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 takes 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).
directories:
- $HOME/.stack
# Workaround for a Travis caching bug on Windows where absolute paths
# are not restored from caches properly:
# https://github.com/travis-ci/casher/pull/38
- .stack_root
# 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.
if ! which stack >/dev/null
then
URL="https://www.stackage.org/stack/$TRAVIS_OS_NAME-x86_64"
mkdir "$HOME/stack"
pushd "$HOME/stack"
if [ "$TRAVIS_OS_NAME" = "windows" ]
then
curl --location "$URL" > stack.zip
unzip stack.zip
mv stack.exe "$HOME/.local/bin/"
else
curl --location "$URL" > stack.tar.gz
tar -xzf stack.tar.gz --strip-components=1
mv stack "$HOME/.local/bin/"
fi
popd
fi
- | # 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
- |
if ! stack --no-terminal setup 2>&1 > stack-setup.log
then
cat stack-setup.log
exit 1
else
# stack setup is very verbose on windows
tail stack-setup.log
fi
- head stack-setup.log
- stack --version
- 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:
# 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