-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.yml
78 lines (77 loc) · 2.86 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
# The Travis docs (https://docs.travis-ci.com/user/languages/haskell)
# suggest that we use `language: haskell` and `ghc:` to specify GHC versions.
# However, as of this writing, Travis only supported versions up to 7.8.
# If Travis supports all versions we would like to test, then we could switch.
# Until then, we use the https://github.com/haskell-CI/haskell-ci setup.
language: c
addons:
apt: &apt
sources:
- hvr-ghc
matrix:
# Cabal version selection:
# In all cases, need 2.0 for new-test.
# Note which versions each https://www.haskell.org/cabal/download.html indicates.
# Using an older version will still allow build to succeed but will warn:
# "Warning: Unknown/unsupported 'ghc' version detected (Cabal 2.4.1.0 supports
# 'ghc' version < 8.7): /opt/ghc/bin/ghc-8.8.1 is version 8.8.1"
include:
# All development machines are >= this version.
- compiler: ghc-8.10.1
addons:
apt:
<<: *apt
packages: [ghc-8.10.1, cabal-install-3.0]
# Lowest version that the overall project will work on.
# sortOn added in base 4.8.0.0,
# which came with GHC 7.10.1.
# No attempt will be made at backwards compatibility.
- compiler: ghc-7.10.1
addons:
apt:
<<: *apt
packages: [ghc-7.10.1, cabal-install-2.0]
# To prove that it doesn't work on older versions:
- compiler: ghc-7.8.4
addons:
apt:
<<: *apt
packages: [ghc-7.8.4, cabal-install-2.0]
allow_failures:
- compiler: ghc-7.10.1
- compiler: ghc-7.8.4
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
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
- rm -rfv $HOME/.cabal/packages/head.hackage
before_install:
- HC=${CC}
- unset CC
install:
- export PATH=$(ls -d /opt/cabal/*)/bin:/opt/ghc/bin:$PATH
- echo $PATH
- ghc --version
- ${HC} --version
- cabal --version
# I don't know why this is update and not new-update but okay
- travis_retry cabal update -v
# Container environment reports 16 cores when it has 2.
# Causes slight slowdowns on `cabal build`,
# for versions where jobs defaults to $ncpus.
# See https://ghc.haskell.org/trac/ghc/ticket/9221
# We fix this by explicitly changing it back to 2.
# Still relevant as of 2019, but the difference is 4 mins vs 5 mins.
- "sed -i.bak 's/^jobs:.*/jobs: 2/' ${HOME}/.cabal/config"
script:
- cabal new-build -w ${HC}
- cabal new-test -w ${HC}
- ghc-pkg list # to debug