on master help sign in
Use Stack to build stylish-haskell in CI
commitaea713d65ece8185e72971a46d0dc85a616d83a4 authorEcho Nolan <echo@echonolan.net> dateThu 6 Oct 2016, 20:10 (10 years ago) parentcacab43
2 files changed+7−10
.travis.yml+2 check-stylish.sh+5−10
.travis.yml+2
@@ -9,6 +9,7 @@ env:
99matrix:
1010 include:
1111 - env: STYLISH=YES
12+ addons: {apt: {packages: [ghc-8.0.1], sources: [hvr-ghc]}}
1213 - os: osx
1314 env: CABALVER="1.24" GHCVER="8.0.1" TESTS="test_c"
1415 compiler: ": #GHC 8.0.1"
@@ -43,6 +44,7 @@ cache:
4344 directories:
4445 - $HOME/.cabsnap
4546 - $HOME/.cabal/packages
47+ - $HOME/.stack
4648
4749before_cache:
4850 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
check-stylish.sh+5−10
@@ -12,19 +12,14 @@ function fail_maybe_explain {
1212
1313if [ -n "$TRAVIS" ];
1414then
15− # It takes a while to compile, let's not tax Travis' infrastructure for no
16− # reason. We can't cache it via cabsnap because that's based on the install-
17− # plan for Idris, which of course doesn't have stylish-haskell as a
18− # dependency.
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
15+ mkdir -p ~/.local/bin
16+ export PATH=$HOME/.local/bin:/opt/ghc/8.0.1/bin:$PATH
17+ curl --retry 3 -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
18+ stack install --resolver lts-7.2 stylish-haskell --no-terminal
2419fi
2520
2621
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
2823
2924# It doesn't do exit codes properly, so we just check if it outputted anything.
3025if [ -s stylish-out ];