dependencies:
  cache_directories:
    - "~/.stack"
    - ".stack-work"
  pre:
    - curl -L https://github.com/commercialhaskell/stack/releases/download/v1.1.2/stack-1.1.2-linux-x86_64.tar.gz | tar zx -C /tmp
    - sudo mv /tmp/stack-1.1.2-linux-x86_64/stack /usr/bin
  override:
    - stack setup
    - rm -fr $(stack path --dist-dir) $(stack path --local-install-root)
    - stack install hlint
    - stack build
    - stack build --test --no-run-tests

test:
  override:
    - createdb postgrest_test
    - stack test
    - git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes "$@"
    - stack sdist

dependencies:
  cache_directories:
    - "~/.stack"
    - ".stack-work"
  pre:
    - curl -L https://github.com/commercialhaskell/stack/releases/download/v1.1.2/stack-1.1.2-linux-x86_64.tar.gz | tar zx -C /tmp
    - sudo mv /tmp/stack-1.1.2-linux-x86_64/stack /usr/bin
  override:
    - stack setup
    - rm -fr $(stack path --dist-dir) $(stack path --local-install-root)
    - stack install hlint
    - stack build
    - stack build --test --no-run-tests

test:
  override:
    - createdb postgrest_test
    - stack test
    - git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes "$@"
    - cp `find .stack-work/install -type f -name postgrest-ws` .
    - gzip ./postgrest-ws
    - cp ./postgrest-ws.gz $CIRCLE_ARTIFACTS

Add copy compiled version gziped to artifacts directory
Add copy compiled version gziped to artifacts directory
