graphql/semaphoreci.sh

41 lines
850 B
Bash
Raw Normal View History

2019-07-04 06:17:11 +02:00
#!/bin/bash
STACK=$SEMAPHORE_CACHE_DIR/stack
export STACK_ROOT=$SEMAPHORE_CACHE_DIR/.stack
2019-07-04 06:17:11 +02:00
setup() {
if [ ! -e "$STACK" ]
then
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C $SEMAPHORE_CACHE_DIR '*/stack'
fi
2020-01-01 10:58:11 +01:00
if [ -e "$SEMAPHORE_CACHE_DIR/graphql.cabal" ]
then
2020-01-11 08:32:25 +01:00
cp -a $SEMAPHORE_CACHE_DIR/graphql.cabal graphql.cabal
fi
2019-07-04 06:17:11 +02:00
$STACK --no-terminal setup
2020-01-11 08:32:25 +01:00
cp -a graphql.cabal $SEMAPHORE_CACHE_DIR/graphql.cabal
2019-07-04 06:17:11 +02:00
}
setup_test() {
$STACK --no-terminal test --only-snapshot
}
test() {
$STACK --no-terminal test --pedantic
}
test_docs() {
2019-09-10 10:06:48 +02:00
$STACK --no-terminal ghc -- -Wall -Werror -fno-code docs/tutorial/tutorial.lhs
2019-09-20 08:47:14 +02:00
$STACK --no-terminal haddock --no-haddock-deps
}
2019-07-04 06:17:11 +02:00
setup_lint() {
$STACK --no-terminal install hlint
}
lint() {
$STACK --no-terminal exec hlint -- src tests
}
$1