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