travis-ci: reorder versions. update builds.

This commit is contained in:
Kei Hibino 2017-02-02 09:45:49 +09:00
parent fc1fc0ac6c
commit 1ae2bcff69
4 changed files with 58 additions and 47 deletions

View File

@ -1,4 +1,3 @@
language: c
sudo: false
@ -19,10 +18,18 @@ matrix:
addons: {apt: {packages: [libgmp-dev]}}
- env: STACK_RESOLVER=lts-7.18
addons: {apt: {packages: [libgmp-dev]}}
- env: STACK_RESOLVER=lts-6.29
addons: {apt: {packages: [libgmp-dev]}}
- env: GHCVER=8.0.1 CABALVER=1.24 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
- env: GHCVER=7.6.3 CABALVER=1.16
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
- env: DEBIANVER=wheezy GHCVER=7.4.1 CABALVER=1.16 NO_CABAL_CACHE=1
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.1], sources: [hvr-ghc]}}
- env: STACK_RESOLVER=lts-6.29
addons: {apt: {packages: [libgmp-dev]}}
- env: GHCVER=7.10.3 CABALVER=1.22 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
- env: GHCVER=7.8.4 CABALVER=1.18 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- env: GHCVER=7.4.1 CABALVER=1.16
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.1], sources: [hvr-ghc]}}
- env: GHCVER=7.4.2 CABALVER=1.16
@ -31,24 +38,16 @@ matrix:
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.1], sources: [hvr-ghc]}}
- env: GHCVER=7.6.2 CABALVER=1.16
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.2], sources: [hvr-ghc]}}
- env: GHCVER=7.6.3 CABALVER=1.16
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
- env: GHCVER=7.8.1 CABALVER=1.18 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.1], sources: [hvr-ghc]}}
- env: GHCVER=7.8.2 CABALVER=1.18 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.2], sources: [hvr-ghc]}}
- env: GHCVER=7.8.3 CABALVER=1.18 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.3], sources: [hvr-ghc]}}
- env: GHCVER=7.8.4 CABALVER=1.18 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
- env: GHCVER=7.10.1 CABALVER=1.22 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
- env: GHCVER=7.10.2 CABALVER=1.22 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
- env: GHCVER=7.10.3 CABALVER=1.22 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
- env: GHCVER=8.0.1 CABALVER=1.24 CABAL_JOBS=-j
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
before_install:
## - cat /proc/cpuinfo
@ -64,6 +63,13 @@ before_install:
export CABAL_CONSTRAINTS='--constraint=transformers==0.3.0.0 --constraint=containers==0.4.2.1 --constraint=bytestring==0.9.2.1 --constraint=text==0.11.2.0 --constraint=time==1.4 --constraint=dlist==0.5 --constraint=convertible==1.0.11.1 --constraint=HDBC==2.3.1.1' ;
;;
'')
case "$GHCVER" in
7.6.*|7.4.*)
export CABAL_CONSTRAINTS='--constraint=time==1.4'
;;
*)
;;
esac ;
;;
*)
echo "Unsupported DEBIANVER, $DEBIANVER" ;

View File

@ -26,43 +26,47 @@ custom_retry cabal update -v
sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
install_package() {
id="$1"
if [ x"$id" = x ]; then
install_plan=installplan.txt
else
install_plan=installplan-${id}.txt
fi
cabal install $CABAL_CONSTRAINTS --only-dependencies --enable-tests --enable-benchmarks --dry -v > ${install_plan}
sed -i -e '1,/^Resolving /d' ${install_plan}; cat ${install_plan}
cabsnap_dir=$HOME/.cabsnap/s-${CABALVER}
# check whether current requested install-plan matches cached package-db snapshot
if [ x"NO_CABAL_CACHE" = x ] && diff -u ${cabsnap_dir}/${install_plan} ${install_plan};
then
echo "cabal build-cache HIT";
rm -rfv .ghc;
cp -a ${cabsnap_dir}/ghc $HOME/.ghc;
cp -a ${cabsnap_dir}/lib ${cabsnap_dir}/share ${cabsnap_dir}/bin $HOME/.cabal/;
else
echo "cabal build-cache MISS";
rm -rf ${cabsnap_dir};
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install $CABAL_JOBS $CABAL_CONSTRAINTS --only-dependencies --enable-tests --enable-benchmarks;
fi
# snapshot package-db on cache miss
if [ ! -d ${cabsnap_dir} ];
then
echo "snapshotting package-db to build-cache";
mkdir -p ${cabsnap_dir};
cp -a $HOME/.ghc ${cabsnap_dir}/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin ${install_plan} ${cabsnap_dir}/;
fi
cabal install $CABAL_JOBS $CABAL_CONSTRAINTS --only-dependencies --enable-tests --enable-benchmarks
}
# install_package() {
# id="$1"
# if [ x"$id" = x ]; then
# install_plan=installplan.txt
# else
# install_plan=installplan-${id}.txt
# fi
# cabal install $CABAL_CONSTRAINTS --only-dependencies --enable-tests --enable-benchmarks --dry -v > ${install_plan}
# sed -i -e '1,/^Resolving /d' ${install_plan}; cat ${install_plan}
# cabsnap_dir=$HOME/.cabsnap/s-${CABALVER}
# # check whether current requested install-plan matches cached package-db snapshot
# if [ x"NO_CABAL_CACHE" = x ] && diff -u ${cabsnap_dir}/${install_plan} ${install_plan};
# then
# echo "cabal build-cache HIT";
# rm -rfv .ghc;
# cp -a ${cabsnap_dir}/ghc $HOME/.ghc;
# cp -a ${cabsnap_dir}/lib ${cabsnap_dir}/share ${cabsnap_dir}/bin $HOME/.cabal/;
# else
# echo "cabal build-cache MISS";
# rm -rf ${cabsnap_dir};
# mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
# cabal install $CABAL_JOBS $CABAL_CONSTRAINTS --only-dependencies --enable-tests --enable-benchmarks;
# fi
# # snapshot package-db on cache miss
# if [ ! -d ${cabsnap_dir} ];
# then
# echo "snapshotting package-db to build-cache";
# mkdir -p ${cabsnap_dir};
# cp -a $HOME/.ghc ${cabsnap_dir}/ghc;
# cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin ${install_plan} ${cabsnap_dir}/;
# fi
# }
if [ x"$dirs" = x ]; then
install_package ''
else

View File

@ -8,6 +8,8 @@ set -x
script_build() {
STACK_YAML=stack-travis.yaml stack build
STACK_YAML=stack-travis.yaml stack test
## '--coverage' may change result of fail or success
STACK_YAML=stack-travis.yaml stack test --coverage
}

View File

@ -8,4 +8,3 @@ flags: {}
extra-package-dbs: []
system-ghc: false
install-ghc: true
skip-ghc-check: true