From cbf1a9869c81bb98a4333b3c9bab4eedea63a2d5 Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Mon, 10 Oct 2016 02:09:15 +0530 Subject: [PATCH] Adds travis scripts for creating and testing source dists. --- .travis.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c36b816..0247e6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,26 @@ before_install: # This line does all of the work: installs GHC if necessary, build the library, # executables, and test suites, and runs the test suites. --no-terminal works # around some quirks in Travis's terminal implementation. -script: stack $ARGS --no-terminal --install-ghc install --test --fast +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 +- cd ringo +- sh ../test_sdist.sh # Caching so the next build will be fast too. cache: