-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
69 lines (62 loc) · 2.95 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
# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
language: c
sudo: false
cache:
directories:
- $HOME/.cabsnap
- $HOME/.cabal/packages
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
matrix:
include:
- compiler: ": #GHC 7.6.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
- compiler: ": #GHC 7.8.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.3], sources: [hvr-ghc]}}
- compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: ": #GHC 8.0.2"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
- compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
- compiler: ": #GHC 8.4.3"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.3], sources: [hvr-ghc]}}
- compiler: ": #GHC 8.6.1"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1], sources: [hvr-ghc]}}
before_install:
- export HC=ghc
- unset CC
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
install:
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
# Update
- travis_retry cabal update -v
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- "[ -f cabal.project.local ] && exit 1 || :"
- "[ -f cabal.project.freeze ] && exit 1 || :"
# Build dependencies
- cabal new-build -w ${HC} --enable-tests --project-file="cabal.project" --dep -j2 all
- cabal new-build -w ${HC} --disable-tests --project-file="cabal.project" --dep -j2 all
- rm -rf "."/.ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
script:
# test that source-distributions can be generated
- for pkg in histogram-fill*; do (cd $pkg; cabal sdist); done
- mv ./*/dist/histogram-fill-*.tar.gz ${DISTDIR}/
- cd ${DISTDIR}
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "echo 'packages: histogram-fill*/*.cabal' > cabal.project"
# this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
# build & run tests.
- cabal new-build -w ${HC} --enable-tests all;
- cabal new-test -w ${HC} --enable-tests all;