From 094eedc4c9783fc963c02b194b364ee1c3b34d84 Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Mon, 10 Oct 2016 02:26:30 +0530 Subject: [PATCH] Fixes travis config by moving out sdist testing script. --- .travis.yml | 27 ++++++++++----------------- test_sdist | 10 ++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) create mode 100755 test_sdist diff --git a/.travis.yml b/.travis.yml index 0247e6d..fce9517 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,26 +34,19 @@ before_install: # around some quirks in Travis's terminal implementation. script: - stack $ARGS --no-terminal --install-ghc install --test --fast -- cat << EOF > test_sdist.sh - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}'); - cd $(stack path | grep dist-dir | awk '{print $2}'); - if [ -f "$SRC_TGZ" ]; then - cabal install "$SRC_TGZ"; - else - echo "expected '$SRC_TGZ' not found"; - exit 1; - fi - EOF - -- stack sdist ringo-core -- cd ringo-core; -- sh ../test_sdist.sh -- cd $(stack path | grep project-root | awk '{print $2}') -- stack sdist ringo +- stack $ARGS --no-terminal install cabal-install happy +- cabal update +- export PATH=$(stack $ARGS path | grep compiler-bin | awk '{print $2}'):$PATH +- stack $ARGS sdist ringo-core +- cd ringo-core +- ../test_sdist +- cd $(stack $ARGS path | grep project-root | awk '{print $2}') +- stack $ARGS sdist ringo - cd ringo -- sh ../test_sdist.sh +- ../test_sdist # Caching so the next build will be fast too. cache: directories: - $HOME/.stack + - $HOME/.cabal diff --git a/test_sdist b/test_sdist new file mode 100755 index 0000000..47ee039 --- /dev/null +++ b/test_sdist @@ -0,0 +1,10 @@ +#!/bin/sh + +SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}'); +cd $(stack $ARGS path | grep dist-dir | awk '{print $2}'); +if [ -f "$SRC_TGZ" ]; then + cabal install "$SRC_TGZ"; +else + echo "expected '$SRC_TGZ' not found"; + exit 1; +fi