travis-CI/stack: switch stack build, not building each directory.

This commit is contained in:
Kei Hibino 2017-07-21 01:45:28 +09:00
parent 4fa9cc4e1e
commit bef4b85cfd
4 changed files with 16 additions and 28 deletions

View File

@ -61,3 +61,11 @@ EOF
esac
set -x
}
show_stack_pkgs() {
echo packages:
for d in $dirs ; do
echo " - ${d}/"
done
echo ''
}

View File

@ -11,20 +11,13 @@ skip_no_match_branch
checkout_root=$(pwd)
install_package() {
(
show_stack_pkgs
sed "s/^resolver: .*/resolver: ${STACK_RESOLVER}/" \
< $checkout_root/travis-CI/stack/template.yaml \
> stack-travis.yaml
## stack.yaml must be located the same directory which has *.cabal -- constraint of stack?
) > stack-travis.yaml
STACK_YAML=stack-travis.yaml stack setup
STACK_YAML=stack-travis.yaml stack install --only-dependencies
}
cat stack-travis.yaml
if [ x"$dirs" = x ]; then
install_package
else
for d in $dirs; do
( cd $d && install_package )
done
fi
STACK_YAML=stack-travis.yaml stack setup
STACK_YAML=stack-travis.yaml stack install --only-dependencies

View File

@ -9,15 +9,5 @@ set -x
skip_no_match_branch
script_build() {
STACK_YAML=stack-travis.yaml stack build
STACK_YAML=stack-travis.yaml stack test
}
if [ x"$dirs" = x ]; then
script_build
else
for d in $dirs; do
( cd $d && script_build )
done
fi
STACK_YAML=stack-travis.yaml stack build
STACK_YAML=stack-travis.yaml stack test

View File

@ -1,8 +1,5 @@
resolver: #foo
packages:
- '.'
extra-deps: []
flags: {}
extra-package-dbs: []