Make Cabal install unconditional in build.cabal.sh (#633)
[hadrian.git] / .travis.yml
1 sudo: true
2 matrix:
3     include:
4         - os: linux
5           env: MODE="selftest"
6           compiler: "GHC 8.2.2"
7           addons:
8               apt:
9                   packages:
10                       - ghc-8.2.2
11                       - cabal-install-2.0
12                       - zlib1g-dev
13                   sources: hvr-ghc
14
15           before_install:
16               - PATH="/opt/ghc/8.2.2/bin:$PATH"
17               - PATH="/opt/cabal/2.0/bin:$PATH"
18
19           script:
20               # Run internal Hadrian tests, after boot and configure.
21               - hadrian/build.sh -c selftest
22
23         - os: linux
24           env: MODE="--flavour=quickest"
25           compiler: "GHC 8.2.2"
26           addons:
27               apt:
28                   packages:
29                       - ghc-8.2.2
30                       - cabal-install-2.0
31                       - zlib1g-dev
32                   sources: hvr-ghc
33
34           before_install:
35               - PATH="/opt/ghc/8.2.2/bin:$PATH"
36               - PATH="/opt/cabal/2.0/bin:$PATH"
37
38           script:
39               # Build GHC, letting hadrian boot & configure the ghc source tree
40               - hadrian/build.sh -c -j $MODE --no-progress --progress-colour=never --profile=-
41
42         - os: linux
43           env: MODE="--flavour=quickest --integer-simple"
44           compiler: "GHC 8.4.1"
45           addons:
46               apt:
47                   packages:
48                       - ghc-8.4.1
49                       - cabal-install-2.2
50                       - zlib1g-dev
51                   sources: hvr-ghc
52
53           before_install:
54               - PATH="/opt/ghc/8.4.1/bin:$PATH"
55               - PATH="/opt/cabal/2.2/bin:$PATH"
56
57           script:
58               # boot, configure and build GHC
59               - hadrian/build.sh -c -j $MODE --no-progress --progress-colour=never --profile=-
60
61               # Test GHC binary
62               - _build/stage1/bin/ghc -e 1+2
63
64         - os: osx
65           osx_image: xcode8
66           env: MODE="--flavour=quickest --integer-simple"
67           before_install:
68               - brew update
69               - brew install ghc cabal-install
70               - brew upgrade python
71
72           script:
73               # Due to timeout limit of OS X build on Travis CI,
74               # we will ignore selftest and build only stage1
75               - hadrian/build.sh -j -c $MODE --no-progress --progress-colour=never --profile=-
76
77               # Test GHC binary
78               - _build/stage1/bin/ghc -e 1+2
79
80 install:
81     # Add Cabal to PATH
82     - PATH="$HOME/.cabal/bin:$PATH"
83     - export PATH
84     - env
85
86     # Fetch GHC sources into ./ghc
87     - git --version
88     - git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
89     - git clone --depth 1 --recursive git://github.com/ghc/ghc
90     # --shallow-submodules is not supported on travis standard git 1.8 (linux), but it is supported
91     # on Travis Mac OS X machines. But it does not work with github mirrors because it cannot
92     # find commits.
93
94     # Install all Hadrian and GHC build dependencies
95     - cabal update
96     - cabal install alex happy
97
98     # GHC comes with an older version of Hadrian, so we delete it
99     - rm -rf ghc/hadrian/.git
100
101     # Travis has already cloned Hadrian into ./ and we need to move it
102     # to ./ghc/hadrian -- one way to do it is to move the .git directory
103     # and perform a hard reset in order to regenerate Hadrian files
104     - mv .git ghc/hadrian
105     - cd ghc/hadrian && git reset --hard HEAD && cd ..
106
107 cache:
108     directories:
109         - $HOME/.cabal
110         - $HOME/.ghc