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