forked from idris-lang/Idris-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
157 lines (149 loc) · 5.87 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
dist: trusty
sudo: false
language: c
env:
global:
- PKGNAME=idris
matrix:
include:
- env: CABALVER="2.2" GHCVER="8.4.1" STACKVER="7.14" STYLISH=YES
addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.2" GHCVER="7.10.3" TESTS="test_c"
compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [cabal-install-2.2,ghc-7.10.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="1.24" GHCVER="8.0.1" TESTS="test_c"
compiler: ": #GHC 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="lib_doc doc"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="test_js"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="test_c"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
#TODO: The idris built with those fails due to libffi dynamic linking version mismatch.
# Caused by the GHC backport to Trusty?
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="lib_doc doc"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="test_js"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="test_c"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
fast-finish: true
cache:
directories:
- $HOME/.cabsnap
- $HOME/.cabal/packages
- $HOME/.stack
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:
- nvm install 6
- nvm use 6
- unset CC
- if [[ $TRAVIS_OS_NAME == 'linux' ]];
then
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH;
export SED=sed;
export ZCAT=zcat;
fi
- env
- if [[ $TRAVIS_OS_NAME == 'osx' ]];
then
brew outdated pkgconfig || brew install pkgconfig;
brew install ghc cabal-install libffi cppcheck gnu-sed;
export PATH=$HOME/.cabal/bin:$PATH;
export SED=gsed;
export ZCAT=gzcat;
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH;
fi
- if [ -n "$STYLISH" ]; then ./stylize.sh; exit $?; fi
install:
- which cabal
- which ghc
- 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:
- ORIGINAL_DIR=$(pwd)
- cabal sdist
- cd ..
- tar -xf ${ORIGINAL_DIR}/dist/${PKGNAME}*.tar.gz
- cd ${PKGNAME}*
script:
###
- echo 'Configure...' && echo -en 'travis_fold:start:script.configure\\r'
- cabal configure -f FFI -f CI --enable-tests
- echo -en 'travis_fold:end:script.configure\\r'
###
- echo 'Build...' && echo -en 'travis_fold:start:script.build\\r'
- cabal build
- echo -en 'travis_fold:end:script.build\\r'
###
- echo 'Copy...' && echo -en 'travis_fold:start:script.copy\\r'
- cabal copy
- echo -en 'travis_fold:end:script.copy\\r'
###
- echo 'Register...' && echo -en 'travis_fold:start:script.register\\r'
- cabal register
- echo -en 'travis_fold:end:script.register\\r'
###
- echo 'Cppcheck...' && echo -en 'travis_fold:start:script.cppcheck\\r'
- if [[ "$TESTS" == "test_c" ]]; then
cppcheck -i 'mini-gmp.c' rts;
fi
- echo -en 'travis_fold:end:script.cppcheck\\r'
###
- echo 'Tests...' && echo -en 'travis_fold:start:script.tests\\r'
- for test in $TESTS; do
echo "make TEST-JOBS=2 $test";
travis_wait make TEST-JOBS=2 $test;
done
- echo -en 'travis_fold:end:script.tests\\r'
###
- echo 'Benchmarks...' && echo -en 'travis_fold:start:script.benchmarks\\r'
- if [[ "$TESTS" == "test_c" ]]; then
cd benchmarks && ./build.pl && ./run.pl && cd ..;
fi
- echo -en 'travis_fold:end:script.benchmarks\\r'
###
# EOF