diff options
-rw-r--r-- | .travis.yml | 101 |
1 files changed, 49 insertions, 52 deletions
diff --git a/.travis.yml b/.travis.yml index 365411c..48bbe70 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -34,70 +34,67 @@ env: | |||
34 | - secure: "cpcJvp233pVNy05VeWgzUEw1xYCekk1xT1x2grzhUx8mpCqXZda+Xbu76QCqLSESPgc8Q39m6bR8c+oLkbgRM1U+hR91+2sccKaP9cLTad0yoPRdm6qDB96mzLcEX+yl22GVVzSg20AZx0B9edIT9z7pnEVMJV4iDwhsx/p5Uas=" | 34 | - secure: "cpcJvp233pVNy05VeWgzUEw1xYCekk1xT1x2grzhUx8mpCqXZda+Xbu76QCqLSESPgc8Q39m6bR8c+oLkbgRM1U+hR91+2sccKaP9cLTad0yoPRdm6qDB96mzLcEX+yl22GVVzSg20AZx0B9edIT9z7pnEVMJV4iDwhsx/p5Uas=" |
35 | 35 | ||
36 | before_install: | 36 | before_install: |
37 | - unset CC | 37 | - unset CC |
38 | - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH | 38 | - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH |
39 | 39 | ||
40 | install: | 40 | install: |
41 | - cabal --version | 41 | - cabal --version |
42 | - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" | 42 | - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" |
43 | - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; | 43 | - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ]; |
44 | then | 44 | then |
45 | zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > | 45 | zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz > |
46 | $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; | 46 | $HOME/.cabal/packages/hackage.haskell.org/00-index.tar; |
47 | fi | 47 | fi |
48 | - travis_retry cabal update -v | 48 | - travis_retry cabal update -v |
49 | - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config | 49 | - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config |
50 | - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt | 50 | - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt |
51 | - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt | 51 | - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt |
52 | 52 | ||
53 | # check whether current requested install-plan matches cached package-db snapshot | 53 | # check whether current requested install-plan matches cached package-db snapshot |
54 | - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; | 54 | - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt; |
55 | then | 55 | then |
56 | echo "cabal build-cache HIT"; | 56 | echo "cabal build-cache HIT"; |
57 | rm -rfv .ghc; | 57 | rm -rfv .ghc; |
58 | cp -a $HOME/.cabsnap/ghc $HOME/.ghc; | 58 | cp -a $HOME/.cabsnap/ghc $HOME/.ghc; |
59 | cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; | 59 | cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/; |
60 | else | 60 | else |
61 | echo "cabal build-cache MISS"; | 61 | echo "cabal build-cache MISS"; |
62 | rm -rf $HOME/.cabsnap; | 62 | rm -rf $HOME/.cabsnap; |
63 | mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; | 63 | mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin; |
64 | cabal install --only-dependencies --enable-tests --enable-benchmarks; | 64 | cabal install --only-dependencies --enable-tests --enable-benchmarks; |
65 | fi | 65 | fi |
66 | 66 | ||
67 | # snapshot package-db on cache miss | 67 | # snapshot package-db on cache miss |
68 | - if [ ! -d $HOME/.cabsnap ]; | 68 | - if [ ! -d $HOME/.cabsnap ]; |
69 | then | 69 | then |
70 | echo "snapshotting package-db to build-cache"; | 70 | echo "snapshotting package-db to build-cache"; |
71 | mkdir $HOME/.cabsnap; | 71 | mkdir $HOME/.cabsnap; |
72 | cp -a $HOME/.ghc $HOME/.cabsnap/ghc; | 72 | cp -a $HOME/.ghc $HOME/.cabsnap/ghc; |
73 | cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; | 73 | cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/; |
74 | fi | 74 | fi |
75 | 75 | ||
76 | # Here starts the actual work to be performed for the package under test; | 76 | # Here starts the actual work to be performed for the package under test; |
77 | # any command which exits with a non-zero exit code causes the build to fail. | 77 | # any command which exits with a non-zero exit code causes the build to fail. |
78 | script: | 78 | script: |
79 | - if [ -f configure.ac ]; then autoreconf -i; fi | 79 | - cabal install hpc-coveralls --constraint=retry==0.6 |
80 | - cabal install hpc-coveralls --constraint=retry==0.6 | 80 | - if [ $CABALVER -eq "1.18" ]; |
81 | - if [ "1.18" = $CABALVER ]; | 81 | then |
82 | then | 82 | cabal configure --enable-tests --enable-benchmarks -v2 --enable-library-coverage |
83 | cabal configure --enable-tests --enable-benchmarks -v2 --enable-library-coverage # -v2 provides useful information for debugging | 83 | else |
84 | else | 84 | cabal configure --enable-tests --enable-benchmarks -v2 --enable-coverage |
85 | cabal configure --enable-tests --enable-benchmarks -v2 --enable-coverage # -v2 provides useful information for debugging | 85 | fi |
86 | fi | 86 | - cabal build # this builds all libraries and executables (including tests/benchmarks) |
87 | - cabal build # this builds all libraries and executables (including tests/benchmarks) | 87 | - run-cabal-test test |
88 | - run-cabal-test test | 88 | - cabal bench |
89 | - cabal bench | 89 | - cabal check |
90 | - cabal check | 90 | - cabal sdist # tests that a source-distribution can be generated |
91 | - cabal sdist # tests that a source-distribution can be generated | 91 | # Check that the resulting source distribution can be built & installed. |
92 | 92 | # If there are no other `.tar.gz` files in `dist`, this can be even simpler: | |
93 | 93 | # `cabal install --force-reinstalls dist/*-*.tar.gz` | |
94 | # Check that the resulting source distribution can be built & installed. | 94 | - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && |
95 | # If there are no other `.tar.gz` files in `dist`, this can be even simpler: | 95 | (cd dist && cabal install --force-reinstalls "$SRC_TGZ") |
96 | # `cabal install --force-reinstalls dist/*-*.tar.gz` | ||
97 | - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && | ||
98 | (cd dist && cabal install --force-reinstalls "$SRC_TGZ") | ||
99 | 96 | ||
100 | after_script: | 97 | after_script: |
101 | - if [ true = $PUSH_DOCS ]; then bash ./scripts/pushdoc.sh; fi | 98 | - if [ true = $PUSH_DOCS ]; then bash ./scripts/pushdoc.sh; fi |
102 | - hpc-coveralls test | 99 | - hpc-coveralls test |
103 | # EOF | 100 | # EOF |