forked from Soostone/katip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
61 lines (53 loc) · 3.09 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
# Use new container infrastructure to enable caching
sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# GHC depends on GMP. You can add other dependencies here as well.
addons:
apt:
packages:
- libgmp-dev
# The different configurations we want to test. You could also do things like
# change flags or use --stack-yaml to point to a different file.
matrix:
include:
- env: ARGS="--resolver=lts-12" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
- env: ARGS="--resolver=lts-12" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
- env: ARGS="--resolver=nightly" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
- env: ARGS="--resolver=nightly" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
# nightlies may fail usually due to lagging dependencies
allow_failures:
- env: ARGS="--resolver=nightly" ESVERSION=5.5.0 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
- env: ARGS="--resolver=nightly" ESVERSION=6.2.2 ESURL=https://artifacts.elastic.co/downloads/elasticsearch ESTESTARGS="--es-version 5" ES_JAVA_OPTS="-Xms500m -Xmx750m"
before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
install:
- wget --no-check-certificate $ESURL/elasticsearch-$ESVERSION.tar.gz
- tar xzf elasticsearch-$ESVERSION.tar.gz
# set up a repo for snapshot testing. Required in ES >= 1.6
- echo "path.repo = [\"/tmp\"]" >> ./elasticsearch-$ESVERSION/elasticsearch.yml
- java -version
- ./elasticsearch-$ESVERSION/bin/elasticsearch &
# Bloodhound seems to take a while to build and can sometimes stall out the build when travis detects no output.
# This line does all of the work: installs GHC if necessary, build the library,
# executables, and test suites, and runs the test suites. --no-terminal works
# around some quirks in Travis's terminal implementation.
script:
- stack $ARGS setup
# Prevent Inactivity timeouts. See https://github.com/travis-ci/travis-ci/issues/7020#issuecomment-288961580
- travis_wait 45 sleep 1800 &
- stack $ARGS test katip:test --no-terminal --haddock --no-haddock-deps
- stack $ARGS test katip-elasticsearch:test --no-terminal --test-arguments="$ESTESTARGS"
- stack $ARGS bench
- stack $ARGS build
- for f in katip/examples/*.hs; do stack $ARGS ghc -- -Wall -Werror $f -o /dev/null; done
- for f in katip-elasticsearch/examples/*.hs; do stack $ARGS ghc -- -Wall -Werror $f -o /dev/null; done
- stack $ARGS sdist
# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.stack
- .stack-work