[commit: packages/bytestring] wip/nix-local-build: Migrate to nix-local-build based .travis.yml (72d21b9)

git at git.haskell.org git at git.haskell.org
Tue May 3 22:44:09 UTC 2016


Repository : ssh://git@git.haskell.org/bytestring

On branch  : wip/nix-local-build
Link       : http://git.haskell.org/packages/bytestring.git/commitdiff/72d21b945addd6c1ca5b2403ec28eba5ed3fb8c5

>---------------------------------------------------------------

commit 72d21b945addd6c1ca5b2403ec28eba5ed3fb8c5
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Wed Apr 13 16:47:47 2016 +0200

    Migrate to nix-local-build based .travis.yml


>---------------------------------------------------------------

72d21b945addd6c1ca5b2403ec28eba5ed3fb8c5
 .travis.yml   | 98 +++++++++++++++++++++++++++++++++++++----------------------
 cabal.project |  1 +
 2 files changed, 62 insertions(+), 37 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 421cfff..05f2f17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,47 +1,71 @@
-env:
- - GHCVER=7.0.4 CABALVER=1.16
- # we have to use CABALVER=1.16 for GHC<7.6 as well, as there's
- # no package for earlier cabal versions in the PPA
- - GHCVER=7.2.2 CABALVER=1.16
- - GHCVER=7.4.2 CABALVER=1.16
- - GHCVER=7.6.3 CABALVER=1.16
- - GHCVER=7.8.2 CABALVER=1.18
- - GHCVER=7.8.3 CABALVER=1.18
- - GHCVER=head  CABALVER=1.20
+# This file has been generated by `make_travis_yml_2.hs`
+# see https://github.com/hvr/multi-ghc-travis for more information
+language: c
+sudo: false
+
+cache:
+  directories:
+    - $HOME/.cabal/packages
+    - $HOME/.cabal/store
+
+before_cache:
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
+  - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
 
 matrix:
-  allow_failures:
-   - env: GHCVER=head  CABALVER=1.20
+  include:
+    - env: CABALVER=1.24 GHCVER=7.4.2
+      compiler: ": #GHC 7.4.2"
+      addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2], sources: [hvr-ghc]}}
+    - env: CABALVER=1.24 GHCVER=7.6.3
+      compiler: ": #GHC 7.6.3"
+      addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}}
+    - env: CABALVER=1.24 GHCVER=7.8.4
+      compiler: ": #GHC 7.8.4"
+      addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}}
+    - env: CABALVER=1.24 GHCVER=7.10.1
+      compiler: ": #GHC 7.10.1"
+      addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.1], sources: [hvr-ghc]}}
 
 before_install:
- - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
- - travis_retry sudo apt-get update
- - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
+ - unset CC
  - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- - cabal --version
 
 install:
- - travis_retry cabal update
- # can't use "cabal install --only-dependencies --enable-tests" due to dep-cycle
- - cabal install "QuickCheck >=2.4" "byteorder ==1.0.*" "dlist ==0.5.*" "mtl >=2.0 && <2.2" deepseq test-framework-hunit test-framework-quickcheck2
+ - cabal --version
+ - BENCH=${BENCH---enable-benchmarks}
+ - TEST=${TEST---enable-tests}
+ - 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
+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
+ - cabal new-build ${TEST} ${BENCH} --dep
 
+# Here starts the actual work to be performed for the package under test;
+# any command which exits with a non-zero exit code causes the build to fail.
 script:
- - cabal configure --enable-tests -v2
- - cabal build
- # --show-details=streaming is available for CABALVER>=1.20 only
- - if [ "$(echo -e "1.20\n$CABALVER" | sort -rV | head -n1)" = "$CABALVER" ]; then
-     cabal test --show-details=streaming;
-   else
-     cabal test --show-details=always;
-   fi
- - cabal sdist
- # "cabal check" disabled due to -O2 warning
- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
-   cd dist/;
-   if [ -f "$SRC_TGZ" ]; then
-      cabal install "$SRC_TGZ";
-   else
-      echo "expected '$SRC_TGZ' not found";
-      exit 1;
-   fi
+ - if [ -f configure.ac ]; then autoreconf -i; fi
+ # this builds all libraries and executables (including tests/benchmarks)
+ - cabal new-build ${TEST} ${BENCH} -v2  # -v2 provides useful information for debugging
+
+ # there's no 'cabal new-test' yet, so let's emulate for now
+ - TESTS=( $(awk 'tolower($0) ~ /^test-suite / { print $2 }' *.cabal) );
+   RC=true; for T in ${TESTS[@]}; do echo "== $T ==";
+   if dist-newstyle/build/*/build/$T/$T; then echo "= $T OK =";
+   else echo "= $T FAILED ="; RC=false; fi; done; $RC
+ - cabal sdist # test that a source-distribution can be generated
+
+ # Check that the resulting source distribution can be built w/o and w tests
+ - SRC_BASENAME=$(cabal info . | awk '{print $2;exit}')
+ - tar -C dist/ -xf dist/$SRC_BASENAME.tar.gz
+ - "echo 'packages: *.cabal' > dist/$SRC_BASENAME/cabal.project"
+ - cd dist/$SRC_BASENAME/
+ - cabal new-build --disable-tests --disable-benchmarks
+ - rm -rf ./dist-newstyle
+ - cabal new-build ${TEST} ${BENCH}
 
+# EOF
diff --git a/cabal.project b/cabal.project
new file mode 100644
index 0000000..0d7f076
--- /dev/null
+++ b/cabal.project
@@ -0,0 +1 @@
+packages: *.cabal



More information about the ghc-commits mailing list