dependencies:
  cache_directories:
    - "~/.stack"
    - ".stack-work"
  pre:
    - curl -L https://github.com/commercialhaskell/stack/releases/download/v1.0.2/stack-1.0.2-linux-x86_64.tar.gz | tar zx -C /tmp
    - sudo mv /tmp/stack-1.0.2-linux-x86_64/stack /usr/bin
    - createuser --superuser --no-password postgrest_test
    - createdb -O postgrest_test -U ubuntu postgrest_test
  override:
    - stack setup
    - stack install hlint packdeps cabal-install
    - stack build --test --no-run-tests

test:
  override:
    - stack test
    - git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes "$@"
    - stack exec -- cabal update
    - stack exec --no-ghc-package-path -- cabal install --only-d --dry-run
    - stack exec -- packdeps *.cabal || true
    - stack exec -- cabal check
    - stack haddock --no-haddock-deps
    - stack sdist

dependencies:
  cache_directories:
    - "~/.stack"
    - ".stack-work"
  pre:
    - curl -L https://github.com/commercialhaskell/stack/releases/download/v1.0.2/stack-1.0.2-linux-x86_64.tar.gz | tar zx -C /tmp
    - sudo mv /tmp/stack-1.0.2-linux-x86_64/stack /usr/bin
    - createuser --superuser --no-password postgrest_test
    - createdb -O postgrest_test -U ubuntu postgrest_test
  override:
    - stack setup
    - stack install hlint packdeps cabal-install
    - rm -fr $(stack path --dist-dir)
    - stack build
    - stack build --test --no-run-tests

test:
  override:
    - stack test
    - git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes "$@"
    - stack exec -- cabal update
    - stack exec --no-ghc-package-path -- cabal install --only-d --dry-run
    - stack exec -- packdeps *.cabal || true
    - stack exec -- cabal check
    - stack haddock --no-haddock-deps
    - stack sdist

Test that binary build succeeds
Test that binary build succeeds

Work around https://github.com/commercialhaskell/stack/issues/1846
