Skip to content

Commit 81162ed

Browse files
committed
Install hspec-discover
1 parent 5dc3dd6 commit 81162ed

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cache:
1818
directories:
1919
- $HOME/.cabal/packages
2020
- $HOME/.cabal/store
21+
- $HOME/.local/bin
2122

2223
before_cache:
2324
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
@@ -46,7 +47,7 @@ matrix:
4647
before_install:
4748
- HC=${CC}
4849
- unset CC
49-
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
50+
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/.local/bin:$PATH
5051
- PKGNAME='servant-swagger'
5152

5253
install:
@@ -56,6 +57,7 @@ install:
5657
- TEST=${TEST---enable-tests}
5758
- travis_retry cabal update -v
5859
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
60+
- sh install-hspec-discover.sh # TEMP: we should use build-tools-depends
5961
- rm -fv cabal.project.local
6062
- "echo 'packages: .' > cabal.project"
6163
- rm -f cabal.project.freeze
@@ -82,8 +84,11 @@ script:
8284
# this builds all libraries and executables (including tests/benchmarks)
8385
# - rm -rf ./dist-newstyle
8486

85-
# build & run tests
87+
# build & run tests, build benchmarks
8688
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
8789
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
8890

91+
# haddock
92+
- cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all
93+
8994
# EOF

install-hspec-discover.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
if [ ! -e $HOME/.local/bin/hspec-discover ]; then
6+
# Fetch the source
7+
cabal get hspec-discover-2.4.4
8+
cd hspec-discover-2.4.4
9+
10+
# Set-up project
11+
echo 'packages: .' > cabal.project
12+
13+
# build exe
14+
cabal new-build hspec-discover:exe:hspec-discover
15+
16+
# copy executable to $HOME/.local/bin
17+
mkdir -p $HOME/.local/bin
18+
cp $(find dist-newstyle -name hspec-discover -type f) $HOME/.local/bin
19+
fi

0 commit comments

Comments
 (0)