on f80809a help sign in
Idris-dev/.travis.yml
167 lines 6.1 kB history raw
1dist: xenial
3language: c
5env:
6 global:
7 - PKGNAME=idris
9matrix:
10 include:
11 - env: CABALVER="2.4" GHCVER="8.6.5" STACKVER="14.15" STYLISH=YES
12 addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.5,hscolour], sources: [hvr-ghc]}}
13 - env: CABALVER="2.4" GHCVER="8.2.2" TESTS="lib_doc doc"
14 compiler: ": #GHC 8.2.2"
15 addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
16 - env: CABALVER="2.4" GHCVER="8.2.2" TESTS="test_js"
17 compiler: ": #GHC 8.2.2"
18 addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
19 - env: CABALVER="2.4" GHCVER="8.2.2" TESTS="test_c"
20 compiler: ": #GHC 8.2.2"
21 addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
22 - env: CABALVER="3.0" GHCVER="8.8.2" IDRIS2=YES
23 addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.2], sources: [hvr-ghc]}}
25# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="lib_doc doc"
26# compiler: ": #GHC 8.8.1"
27# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
28# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="test_js"
29# compiler: ": #GHC 8.8.1"
30# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
31# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="test_c"
32# compiler: ": #GHC 8.8.1"
33# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
34 fast-finish: true
36cache:
37 directories:
38 - $HOME/.cabsnap
39 - $HOME/.cabal/packages
40 - $HOME/.stack
42before_cache:
43 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
44 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
46before_install:
47 - nvm install 6
48 - nvm use 6
49 - unset CC
50 - if [[ $TRAVIS_OS_NAME == 'linux' ]];
51 then
52 export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$HOME/opt/scheme/bin/:$PATH;
53 export SED=sed;
54 export ZCAT=zcat;
55 fi
56 - env
57 - if [[ $TRAVIS_OS_NAME == 'osx' ]];
58 then
59 brew outdated pkgconfig || brew install pkgconfig;
60 brew install ghc cabal-install libffi cppcheck gnu-sed;
61 export PATH=$HOME/.cabal/bin:$PATH;
62 export SED=gsed;
63 export ZCAT=gzcat;
64 export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:$PKG_CONFIG_PATH;
65 fi
66 - if [ -n "$STYLISH" ]; then ./stylize.sh; exit $?; fi
67 - if [ -n "$IDRIS2" ];
68 then
69 git clone https://github.com/edwinb/Idris2 &&
70 wget https://github.com/cisco/ChezScheme/archive/v9.5.2.tar.gz &&
71 tar xvzf v9.5.2.tar.gz &&
72 cd ChezScheme-9.5.2 &&
73 ./configure --threads --installprefix=$HOME/opt/scheme &&
74 make -j install &&
75 cd .. &&
76 cabal v1-update &&
77 travis_wait cabal v1-install &&
78 cd Idris2 &&
79 make idris2 && make base && make contrib;
80 exit $?;
81 fi
83install:
84 - which cabal
85 - which ghc
86 - cabal --version
87 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
88 - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
89 then
90 $ZCAT $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
91 $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
92 fi
93 - travis_retry cabal update -v
94 # Run build with 2 parallel jobs
95 # The container environment reports 16 cores,
96 # causing cabal's default configuration (jobs: $ncpus)
97 # to run into the GHC #9221 bug which can result in longer build-times.
98 - $SED -i -r 's/(^jobs:).*/\1 2/' $HOME/.cabal/config
99 - cabal v1-install -f FFI --only-dependencies --enable-tests --dry -v > installplan.txt
100 - $SED -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
101 # check whether current requested install-plan matches cached package-db snapshot
102 - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
103 then
104 echo "cabal build-cache HIT";
105 rm -rfv .ghc;
106 cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
107 cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
108 else
109 echo "cabal build-cache MISS";
110 rm -rf $HOME/.cabsnap;
111 mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
112 cabal v1-install -f FFI --only-dependencies --enable-tests;
113 fi
114 # snapshot package-db on cache miss
115 - if [ ! -d $HOME/.cabsnap ];
116 then
117 echo "snapshotting package-db to build-cache";
118 mkdir $HOME/.cabsnap;
119 cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
120 cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
121 fi
124before_script:
125 - ORIGINAL_DIR=$(pwd)
126 - cabal v1-sdist
127 - cd ..
128 - tar -xf ${ORIGINAL_DIR}/dist/${PKGNAME}*.tar.gz
129 - cd ${PKGNAME}*
130script:
131###
132 - echo 'Configure...' && echo -en 'travis_fold:start:script.configure\\r'
133 - cabal v1-configure -f FFI -f CI --enable-tests
134 - echo -en 'travis_fold:end:script.configure\\r'
135###
136 - echo 'Build...' && echo -en 'travis_fold:start:script.build\\r'
137 - cabal v1-build
138 - echo -en 'travis_fold:end:script.build\\r'
139###
140 - echo 'Copy...' && echo -en 'travis_fold:start:script.copy\\r'
141 - cabal v1-copy
142 - echo -en 'travis_fold:end:script.copy\\r'
143###
144 - echo 'Register...' && echo -en 'travis_fold:start:script.register\\r'
145 - cabal v1-register
146 - echo -en 'travis_fold:end:script.register\\r'
147###
148 - echo 'Cppcheck...' && echo -en 'travis_fold:start:script.cppcheck\\r'
149 - if [[ "$TESTS" == "test_c" ]]; then
150 cppcheck -i 'mini-gmp.c' rts;
151 fi
152 - echo -en 'travis_fold:end:script.cppcheck\\r'
153###
154 - echo 'Tests...' && echo -en 'travis_fold:start:script.tests\\r'
155 - for test in $TESTS; do
156 echo "make TEST-JOBS=2 $test";
157 travis_wait make TEST-JOBS=2 $test;
158 done
159 - echo -en 'travis_fold:end:script.tests\\r'
160###
161 - echo 'Benchmarks...' && echo -en 'travis_fold:start:script.benchmarks\\r'
162 - if [[ "$TESTS" == "test_c" ]]; then
163 cd benchmarks && ./build.pl && ./run.pl && cd ..;
164 fi
165 - echo -en 'travis_fold:end:script.benchmarks\\r'
166###
167# EOF