forked from idris-lang/Idris-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
109 lines (99 loc) · 3.36 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
sudo: false
language: c
addons:
apt:
sources:
- hvr-ghc
packages:
- ghc-7.6.3
- ghc-7.8.4
- ghc-7.10.2
- cabal-install-1.20
- cabal-install-1.22
# test dependencies
- expect
- cppcheck
- hscolour
matrix:
include:
- env: CABALVER="1.20" GHCVER="7.6.3" TESTS="test_c"
# separate caches for different compiler versions
# until https://github.com/travis-ci/travis-ci/issues/4393 is resolved
compiler: ": #GHC 7.6.3"
- env: CABALVER="1.20" GHCVER="7.8.4" TESTS="lib_doc doc"
compiler: ": #GHC 7.8.4"
- env: CABALVER="1.20" GHCVER="7.8.4" TESTS="test_js"
compiler: ": #GHC 7.8.4"
- env: CABALVER="1.20" GHCVER="7.8.4" TESTS="test_c"
compiler: ": #GHC 7.8.4"
- env: CABALVER="1.22" GHCVER="7.10.2" TESTS="lib_doc doc"
compiler: ": #GHC 7.10.2"
- env: CABALVER="1.22" GHCVER="7.10.2" TESTS="test_js"
compiler: ": #GHC 7.10.2"
- env: CABALVER="1.22" GHCVER="7.10.2" TESTS="test_c"
compiler: ": #GHC 7.10.2"
cache:
directories:
- $HOME/.cabsnap
- $HOME/.cabal/packages
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
before_install:
- unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH
- env
install:
- cabal --version
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
then
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
fi
- travis_retry cabal update -v
# Run build with 2 parallel jobs
# The container environment reports 16 cores,
# causing cabal's default configuration (jobs: $ncpus)
# to run into the GHC #9221 bug which can result in longer build-times.
- sed -i -r 's/(^jobs:).*/\1 2/' $HOME/.cabal/config
- cabal install -f FFI --only-dependencies --enable-tests --dry -v > installplan.txt
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
# check whether current requested install-plan matches cached package-db snapshot
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
then
echo "cabal build-cache HIT";
rm -rfv .ghc;
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
else
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install -f FFI --only-dependencies --enable-tests;
fi
# snapshot package-db on cache miss
- if [ ! -d $HOME/.cabsnap ];
then
echo "snapshotting package-db to build-cache";
mkdir $HOME/.cabsnap;
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
fi
before_script:
- cabal sdist
- cd ..
- tar -xf Idris-dev/dist/idris*.tar.gz
- cd idris*
script:
- cabal configure -f FFI -f CI
- cabal build
- cabal copy
- cabal register
- if [[ "$TESTS" == "test_c" ]]; then
cppcheck -i 'mini-gmp.c' rts;
fi
- for test in $TESTS; do
echo "make -j2 $test";
make -j2 $test;
done