packages feed

twitter-conduit-0.1.2: .travis.yml

sudo: false
language: c

matrix:
  include:
    - env: GHCVER=7.8.4 STACK_YAML=stack-lts-2.yml
      addons:
        apt:
          sources: [ hvr-ghc ]
          packages: [ ghc-7.8.4 ]
    - env: GHCVER=7.10.2 STACK_YAML=stack-lts-3.yml
      addons:
        apt:
          sources: [ hvr-ghc ]
          packages: [ ghc-7.10.2 ]

before_install:
  - mkdir -p ~/.local/bin
  - export PATH=~/.local/bin:$PATH
  - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v0.1.4.0/stack-0.1.4.0-x86_64-linux.tar.gz | tar xz -C ~/.local/bin
  - export PATH=/opt/ghc/$GHCVER/bin:$PATH

install:
  - travis_wait stack --no-terminal --skip-ghc-check setup
  - travis_wait stack --no-terminal --skip-ghc-check test --only-snapshot

script:
  - travis_wait stack --no-terminal --skip-ghc-check test

  # tests source distribution package
  - mkdir -p ./.test-sdist
  - stack sdist 2>&1 | tee ./.test-sdist/sdist-log
  - |
    PKGNAME="$(cabal info . | awk '/^\*/{print $2}')"
    SRCTGZ=$(readlink -f $(awk '/^Wrote sdist tarball to / { print $5 }' sdist-log))
    cd ./.test-sdist
    if [ -f "$SRCTGZ" ]; then
      tar xvzf "$SRCTGZ"
      cd "$PKGNAME"
      NG=$(git ls-tree HEAD --full-tree -r | while read perm blob hash name; do [ -e "$name" ] || echo NG "$name"; done)
      if [ -n "$NG" ]; then
        echo "Missing files:"
        echo $NG
        exit 1
      fi
    fi

cache:
  directories:
    - ~/.stack