forked from llvm-hs/llvm-hs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
86 lines (79 loc) · 3.74 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
79
80
81
82
83
84
85
86
language: c
dist: trusty
sudo: false
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/llvm-build-8.0.0
- $HOME/llvm-src-8.0.0
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
# 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
env:
global:
- GCC=gcc-5
- GXX=g++-5
- LLVM_VER=8.0.0
matrix:
include:
- compiler: "ghc-8.0.2"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2,gcc-5,g++-5], sources: [hvr-ghc,ubuntu-toolchain-r-test]}}
- compiler: "ghc-8.2.2"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2,gcc-5,g++-5], sources: [hvr-ghc,ubuntu-toolchain-r-test]}}
- compiler: "ghc-8.4.4"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4,gcc-5,g++-5], sources: [hvr-ghc,ubuntu-toolchain-r-test]}}
- compiler: "ghc-8.6.4"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4,gcc-5,g++-5], sources: [hvr-ghc,ubuntu-toolchain-r-test]}}
before_install:
# Prune path, see https://github.com/travis-ci/travis-ci/issues/5326
- export PATH="$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")"
- HC=${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
- PKGNAME='llvm-hs'
- export CC=/usr/bin/$GCC
- export CXX=/usr/bin/$GXX
- export LD_LIBRARY_PATH=$HOME/llvm-build-${LLVM_VER}/lib:$LD_LIBRARY_PATH
- export PATH=$HOME/llvm-build-${LLVM_VER}/bin:$PATH
- mkdir -p $HOME/bin
- export PATH=$HOME/bin:$PATH
install:
- curl https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.tar.gz | tar -xzf - -C $HOME
- export PATH=$HOME/cmake-3.12.2-Linux-x86_64/bin:$PATH
- curl -L https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip -o ninja-linux.zip
- unzip ninja-linux.zip -d $HOME/bin
- curl http://prereleases.llvm.org/8.0.0/rc3/llvm-8.0.0rc3.src.tar.xz | tar -xJf - -C $HOME
- rsync -ac $HOME/llvm-${LLVM_VER}rc3.src/ $HOME/llvm-src-${LLVM_VER}
# - curl http://releases.llvm.org/${LLVM_VER}/llvm-${LLVM_VER}.src.tar.xz | tar -xJf - -C $HOME
# - rsync -ac $HOME/llvm-${LLVM_VER}.src/ $HOME/llvm-src-${LLVM_VER}
# - curl -L https://github.com/llvm-mirror/llvm/archive/089d4c0c490687db6c75f1d074e99c4d42936a50.zip -o out.zip
# - unzip -q out.zip -d $HOME
# - rsync -ac $HOME/llvm-089d4c0c490687db6c75f1d074e99c4d42936a50/ $HOME/llvm-src-${LLVM_VER}
- cd $HOME/llvm-src-${LLVM_VER}
- mkdir -p build && cd build
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE=-O0 -DCMAKE_INSTALL_PREFIX=$HOME/llvm-build-${LLVM_VER} -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_LLVM_DYLIB=True -DLLVM_LINK_LLVM_DYLIB=True -GNinja ..
- ninja -j3 install
- cd $TRAVIS_BUILD_DIR
- ln -s $HOME/llvm-build-${LLVM_VER}/bin/llvm-config $HOME/bin/llvm-config
- llvm-config --version
- $GCC --version
- $GXX --version
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update -v
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- rm -rf .ghc.environment.*
- cabal new-configure --with-gcc $GCC --ghc-options "-pgmc=${GCC}" --enable-tests
- cabal new-build -w ${HC} --dep -j2 all
script:
- cabal new-build -w ${HC} all
- cabal new-test -w ${HC} all
- cabal new-haddock -w ${HC} all