forked from haskell-tools/haskell-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
81 lines (70 loc) · 2.94 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
# Use new container infrastructure to enable caching
sudo: false
# Choose a lightweight base image; we provide our own build tools.
language: c
# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack
# The different configurations we want to test. We have BUILD=cabal which uses
# cabal-install, and BUILD=stack which uses Stack. More documentation on each
# of those below.
#
# We set the compiler values here to tell Travis to use a different
# cache file per set of arguments.
#
# If you need to have different apt packages for each combination in the
# matrix, you can use a line such as:
# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
matrix:
include:
# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
# variable, such as using --stack-yaml to point to a different file.
- env:
- BUILD=stack
- BUILD_ARGS="--no-terminal --test --no-run-tests --bench --no-run-benchmarks"
- DOC_ARGS="--haddock --no-haddock-deps"
- TEST_ARGS="--no-terminal --coverage"
compiler: ": #stack default"
if: type IN (push, pull_request)
- env:
- BUILD=stack
- BUILD_ARGS="--no-terminal --test --no-run-tests --bench --no-run-benchmarks"
- DOC_ARGS=""
- TEST_ARGS=""
compiler: ": #stack nightly"
if: type = cron
before_install:
# Using compiler above sets CC to an invalid value, so unset it
- unset CC
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
install:
# Install all dependecies of Haskell-tools, including test requirements
- travis_wait 30 stack --install-ghc build $BUILD_ARGS $DOC_ARGS --only-dependencies
script:
# Build Haskell-tools with all library, executable, test and benchmark
- travis_wait 30 stack build $BUILD_ARGS $DOC_ARGS
# Check that the source distribution can be created
- stack sdist
# Run tests. We record test coverage information. We need to perform all of them at once to create the unified coverage reports.
# Disabled on nightly builds (done when checking the distribution zips anyway).
# On nightly build run the script to run self-test and test package distributions.
- |
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then
travis_wait 30 stack test $TEST_ARGS $DOC_ARGS haskell-tools-rewrite haskell-tools-builtin-refactorings haskell-tools-experimental-refactorings haskell-tools-daemon haskell-tools-cli haskell-tools-demo
else
bash ./daily.sh
fi
after_script:
# Run benchmarks. Need to uninstall first to run this without coverage reporting, so the result will be more accurate.
- |
if [ "$TRAVIS_EVENT_TYPE" = "cron" ];
then
travis_wait 20 stack $ARGS bench haskell-tools-cli > benchmark.txt 2>&1
fi
# Publish API, coverage and benchmark data to our site
- bash ./deploy.sh