From 13988badac6cb5789d3d03f22fc837cfb5a50882 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 20:51:40 +0530 Subject: [PATCH 1/7] Add basic travis CI --- .travis.yml | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b6c1b8b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,90 @@ +sudo: false +language: c +cache: + directories: + - "$HOME/.ghc" + - "$HOME/.cabal" + - "$HOME/.stack" +matrix: + include: + - env: BUILD=stack ARGS="--resolver lts-6.20" + compiler: ": #stack 8.0.2" + +before_install: +# Using compiler above sets CC to an invalid value, so unset it +- unset CC + +# We want to always allow newer versions of packages when building on GHC HEAD +- CABALARGS="" +- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi + +# Download and unpack the stack executable +- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH +- mkdir -p ~/.local/bin +- | + if [ `uname` = "Darwin" ] + then + travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin + else + travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' + fi + + # Use the more reliable S3 mirror of Hackage + mkdir -p $HOME/.cabal + echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config + echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config + + if [ "$CABALVER" != "1.16" ] + then + echo 'jobs: $ncpus' >> $HOME/.cabal/config + fi + +install: +- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" +- if [ -f configure.ac ]; then autoreconf -i; fi +- | + set -ex + case "$BUILD" in + stack) + stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies + ;; + cabal) + cabal --version + travis_retry cabal update + + # Get the list of packages from the stack.yaml file + PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') + + cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES + ;; + esac + set +ex + +script: +- | + set -ex + case "$BUILD" in + stack) + stack --no-terminal $ARGS test --bench --no-run-benchmarks + ;; + cabal) + cabal install --enable-tests $RUN_TESTS --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES + + ORIGDIR=$(pwd) + for dir in $PACKAGES + do + cd $dir + cabal check || [ "$CABALVER" == "1.16" ] + cabal sdist + PKGVER=$(cabal info . | awk '{print $2;exit}') + SRC_TGZ=$PKGVER.tar.gz + cd dist + tar zxfv "$SRC_TGZ" + cd "$PKGVER" + cabal configure --enable-tests + cabal build + cd $ORIGDIR + done + ;; + esac + set +ex From c69026a90b771b1e5c08b0920d07586366c95f3c Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 20:55:24 +0530 Subject: [PATCH 2/7] Compiler is 7.10.3 for lts-6.20 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b6c1b8b..b46559a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: matrix: include: - env: BUILD=stack ARGS="--resolver lts-6.20" - compiler: ": #stack 8.0.2" + compiler: ": #stack 7.10.3" before_install: # Using compiler above sets CC to an invalid value, so unset it From f078c7ade03fda8db51e3a400cfca2b15b087a96 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 20:57:02 +0530 Subject: [PATCH 3/7] Add libgmp --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b46559a..db4b801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,11 @@ cache: matrix: include: - env: BUILD=stack ARGS="--resolver lts-6.20" - compiler: ": #stack 7.10.3" + compiler: ": #stack 7.10.3 + addons: + apt: + packages: + - libgmp-dev" before_install: # Using compiler above sets CC to an invalid value, so unset it From 108b2079488ae841f472247ea3518b0cd9d47b4a Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 21:03:41 +0530 Subject: [PATCH 4/7] Remove quote --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db4b801..24c7ccb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: addons: apt: packages: - - libgmp-dev" + - libgmp-dev before_install: # Using compiler above sets CC to an invalid value, so unset it From 8a4b177cc88074f221ca651cd05a91af71defa4d Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 21:04:53 +0530 Subject: [PATCH 5/7] Fix quotes --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 24c7ccb..8c334ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: matrix: include: - env: BUILD=stack ARGS="--resolver lts-6.20" - compiler: ": #stack 7.10.3 + compiler: ": #stack 7.10.3" addons: apt: packages: From ed6ab688ce35febfe4ce3ed7b6da820de556c38c Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 22:40:41 +0530 Subject: [PATCH 6/7] Add libjudydebian1 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8c334ae..c6d955d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ matrix: apt: packages: - libgmp-dev + - libjudydebian1 before_install: # Using compiler above sets CC to an invalid value, so unset it From 9d3e3eac8d8f7dbf041e793f9d44d0c5d0e2572f Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Sun, 19 Mar 2017 22:53:09 +0530 Subject: [PATCH 7/7] Add libjudy-dev --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c6d955d..7b78da9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: packages: - libgmp-dev - libjudydebian1 + - libjudy-dev before_install: # Using compiler above sets CC to an invalid value, so unset it