before_script:
  - cabal update
  - cabal install stylish-haskell
  - cabal install hlint
test:alltests:
  image: zenhack/haskell-capnp-ci
  script:
      # Run the tests:
    - cabal new-build
    - cabal new-test
      # Linting:
    - ./hlint.sh
      # Run stylish-haskell, and fail if it changes anything:
    - ./format.sh
    - git diff --exit-code

before_script: |
  cabal update

  # Install stylish-haskell and hlint. We build them with new-build, so they
  # will be more likely to share built dependencies with both each other and
  # haskell-capnp.
  #
  for pkg in stylish-haskell hlint; do
    cd /tmp
    cabal unpack $pkg
    cd $pkg-*
    cabal new-build
    cp $(find dist-newstyle -type f -name $pkg) ~/.cabal/bin/
  done
test:alltests:
  image: zenhack/haskell-capnp-ci
  script:
      # Run the tests:
    - cabal new-build
    - cabal new-test
      # Linting:
    - ./hlint.sh
      # Run stylish-haskell, and fail if it changes anything:
    - ./format.sh
    - git diff --exit-code

Use new-build to build hlint & stylish-haskell
Use new-build to build hlint & stylish-haskell
