[commit: packages/process] master: Switch to Travis caching with Stack and OS X support (543aa1c)

git at git.haskell.org git at git.haskell.org
Thu Apr 7 12:04:31 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/543aa1c3701d5025923a3c1769854b0afd353158/process

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

commit 543aa1c3701d5025923a3c1769854b0afd353158
Author: Michael Snoyman <michael at snoyman.com>
Date:   Sun Jan 24 15:13:29 2016 +0200

    Switch to Travis caching with Stack and OS X support


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

543aa1c3701d5025923a3c1769854b0afd353158
 .travis.yml | 130 ++++++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 95 insertions(+), 35 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 911a546..0b1b95d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,44 +1,104 @@
-env:
- - GHCVER=7.2.1 CABALVER=1.16
- - GHCVER=7.2.2 CABALVER=1.16
- - GHCVER=7.4.2 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.6.3 CABALVER=1.16
- - GHCVER=7.8.4 CABALVER=1.18
- - GHCVER=7.10.1 CABALVER=1.22
- - GHCVER=7.10.2 CABALVER=1.22
- - GHCVER=head  CABALVER=head
+language: c
+sudo: false
+
+cache:
+  directories:
+  - $HOME/.ghc
+  - $HOME/.cabal
+  - $HOME/.stack
 
 matrix:
+  include:
+  - env: BUILD=cabal GHCVER=7.2.1 CABALVER=1.16
+    compiler: ": #GHC 7.2.1"
+    addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.1], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16
+    compiler: ": #GHC 7.2.2"
+    addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16
+    compiler: ": #GHC 7.4.2"
+    addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
+  # 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
+  - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16
+    compiler: ": #GHC 7.6.3"
+    addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18
+    compiler: ": #GHC 7.8.4"
+    addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.10.1 CABALVER=1.22
+    compiler: ": #GHC 7.10.1"
+    addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.10.2 CABALVER=1.22
+    compiler: ": #GHC 7.10.2"
+    addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
+  - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22
+    compiler: ": #GHC 7.10.3"
+    addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
+
+  - env: BUILD=stack GHCVER=7.8.4
+    compiler: ": #stack 7.8.4"
+    addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}
+
+  - env: BUILD=stack GHCVER=7.10.3
+    compiler: ": #stack 7.10.3"
+    addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}}
+
+  - env: BUILD=stack GHCVER=7.8.4
+    compiler: ": #stack 7.8.4 osx"
+    os: osx
+
+  - env: BUILD=stack GHCVER=7.10.3
+    compiler: ": #stack 7.10.3 osx"
+    os: osx
+
+  - env: BUILD=cabal GHCVER=head  CABALVER=head
+    addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}}
+
   allow_failures:
-   - env: GHCVER=head  CABALVER=head
+  - env: BUILD=cabal GHCVER=head  CABALVER=head
+  - env: BUILD=stack GHCVER=7.8.4
 
 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
- - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
- - cabal --version
+ - unset CC
+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$PATH
+ - mkdir -p ~/.local/bin
+ - if [ `uname` = "Darwin" ];
+   then
+     curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
+   else
+     curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack';
+   fi
 
 install:
- - travis_retry cabal update
- - cabal install --only-dependencies
- - ghc --version
+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
+ - autoreconf -i
+ - |
+   case "$BUILD" in
+     stack)
+       echo "resolver: ghc-$GHCVER" > stack.yaml;
+       stack --no-terminal --install-ghc test --only-dependencies;;
+     cabal)
+       cabal --version;
+       travis_retry cabal update;
+       rm -f $(stack path --dist-dir)/stack-*.tar.gz;
+       stack sdist --pvp-bounds=both;
+       tar xf $(stack path --dist-dir)/stack-*.tar.gz --wildcards --strip-components=1 '*/stack.cabal';
+       cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0;;
+   esac
 
 script:
- - autoreconf -i
- - cabal configure -v2 --enable-tests --ghc-options="-Wall -Werror"
- - cabal build
- - cabal check || [ "$CABALVER" == "1.16" ]
- - ./dist/build/test/test # Using cabal test was giving trouble with cabal 1.22
- - cabal sdist
-# The following scriptlet checks that the resulting source distribution can be built & installed
- - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ;
-   cd dist/;
-   if [ -f "$SRC_TGZ" ]; then
-      cabal install --force-reinstalls "$SRC_TGZ";
-   else
-      echo "expected '$SRC_TGZ' not found";
-      exit 1;
-   fi
+ - case "$BUILD" in
+     stack)
+       stack --no-terminal test --haddock --no-haddock-deps;;
+     cabal)
+       cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 -Werror";
+       cabal build;
+       cabal check || [ "$CABALVER" == "1.16" ];
+       true Using cabal test was giving trouble with cabal 1.22;
+       ./dist/build/test/test;
+       cabal sdist;
+       cabal copy;
+       SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
+       (cd dist && cabal install --force-reinstalls "$SRC_TGZ");;
+   esac



More information about the ghc-commits mailing list