-
Notifications
You must be signed in to change notification settings - Fork 644
/
.travis.yml
168 lines (159 loc) · 6.13 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
158
159
160
161
162
163
164
165
166
167
168
dist: xenial
language: c
env:
global:
- PKGNAME=idris
matrix:
include:
- env: CABALVER="2.4" GHCVER="8.6.5" STACKVER="15.4" STYLISH=YES
addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.5,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="lib_doc doc"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="test_js"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="test_c"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="lib_doc doc"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="test_js"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="test_c"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="3.0" GHCVER="8.8.3" IDRIS2=YES
# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3], 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:$HOME/opt/scheme/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
- if [ -n "$IDRIS2" ];
then
git clone https://github.com/edwinb/Idris2-boot &&
wget https://github.com/cisco/ChezScheme/archive/v9.5.2.tar.gz &&
tar xvzf v9.5.2.tar.gz &&
cd ChezScheme-9.5.2 &&
./configure --threads --installprefix=$HOME/opt/scheme &&
make -j install &&
cd .. &&
cabal v1-update &&
travis_wait cabal v1-install --only-dependencies &&
travis_wait cabal v1-install &&
cd Idris2 &&
travis_wait make idris2 && make base && make contrib;
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 v1-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 v1-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 v1-sdist
- cd ..
- tar -xf ${ORIGINAL_DIR}/dist/${PKGNAME}*.tar.gz
- cd ${PKGNAME}*
script:
- export LD_PRELOAD=/opt/ghc/${GHCVER}/lib/ghc-${GHCVER}/rts/libffi.so.7
###
- echo 'Configure...' && echo -en 'travis_fold:start:script.configure\\r'
- cabal v1-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 v1-build
- echo -en 'travis_fold:end:script.build\\r'
###
- echo 'Copy...' && echo -en 'travis_fold:start:script.copy\\r'
- cabal v1-copy
- echo -en 'travis_fold:end:script.copy\\r'
###
- echo 'Register...' && echo -en 'travis_fold:start:script.register\\r'
- cabal v1-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