on master help sign in
Use Stack to build stylish-haskell in CI
aea713dEcho Nolan
.travis.yml+2
@@ -9,6 +9,7 @@ env:
9matrix:
9matrix:
10 include:
10 include:
11 - env: STYLISH=YES
11 - env: STYLISH=YES
12+ addons: {apt: {packages: [ghc-8.0.1], sources: [hvr-ghc]}}
12 - os: osx
13 - os: osx
13 env: CABALVER="1.24" GHCVER="8.0.1" TESTS="test_c"
14 env: CABALVER="1.24" GHCVER="8.0.1" TESTS="test_c"
14 compiler: ": #GHC 8.0.1"
15 compiler: ": #GHC 8.0.1"
@@ -43,6 +44,7 @@ cache:
43 directories:
44 directories:
44 - $HOME/.cabsnap
45 - $HOME/.cabsnap
45 - $HOME/.cabal/packages
46 - $HOME/.cabal/packages
47+ - $HOME/.stack
46
48
47before_cache:
49before_cache:
48 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
50 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
check-stylish.sh+5−10
@@ -12,19 +12,14 @@ function fail_maybe_explain {
12
12
13if [ -n "$TRAVIS" ];
13if [ -n "$TRAVIS" ];
14then
14then
15− # It takes a while to compile, let's not tax Travis' infrastructure for no
15+ mkdir -p ~/.local/bin
16− # reason. We can't cache it via cabsnap because that's based on the install-
16+ export PATH=$HOME/.local/bin:/opt/ghc/8.0.1/bin:$PATH
17− # plan for Idris, which of course doesn't have stylish-haskell as a
17+ curl --retry 3 -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
18− # dependency.
18+ stack install --resolver lts-7.2 stylish-haskell --no-terminal
19− STYLISH_EXE=$(mktemp)
20− wget -O $STYLISH_EXE "https://s3-us-west-2.amazonaws.com/idris-travis-binaries/stylish-haskell"
21− chmod +x $STYLISH_EXE
22−else
23− STYLISH_EXE=stylish-haskell
24fi
19fi
25
20
26
21
27−find . -name \*.hs -and \( -not -name Setup.hs \) | xargs $STYLISH_EXE -i > stylish-out 2>&1
22+find . -name \*.hs -and \( -not -name Setup.hs \) | xargs stylish-haskell -i > stylish-out 2>&1
28
23
29# It doesn't do exit codes properly, so we just check if it outputted anything.
24# It doesn't do exit codes properly, so we just check if it outputted anything.
30if [ -s stylish-out ];
25if [ -s stylish-out ];