before_script:
  # Report the versions of varioius software, to make diagnosing problems
  # easier:
  - ghc --version
  - cabal --version
  - capnp --version
  - stylish-haskell --version
  - hlint --version
  # Update the hackage databse:
  - cabal update
test:alltests:
  image: zenhack/haskell-capnp-ci
  script:
    - cabal new-build all
    - cabal new-test
      # Linting:
    - ./scripts/hlint.sh
      # Run stylish-haskell, and fail if it changes anything:
    - ./scripts/format.sh
    - git diff --exit-code
      # Regenerate the schema, and make sure they're in-sync
      # with what was committed:
    - ./scripts/regen.sh
    - git diff --exit-code

before_script:
  # Report the versions of varioius software, to make diagnosing problems
  # easier:
  - ghc --version
  - cabal --version
  - capnp --version
  - stylish-haskell --version
  - hlint --version
  # Update the hackage databse:
  - cabal update
test:alltests:
  image: zenhack/haskell-capnp-ci
  script:
    # First build the code generator plugin.
    - cabal new-build capnpc-haskell
    # Then, regenerate the schema modules, and make sure they're in-sync
    # with what was committed. This is also necessary to generate the
    # Schema modules used by the test suite, which are not committed.
    - ./scripts/regen.sh
    - git diff --exit-code
    # Now build everything else (incl. examples):
    - cabal new-build all
    # ...run the tests:
    - cabal new-test
    # Linting:
    - ./scripts/hlint.sh
    # Run stylish-haskell, and fail if it changes anything:
    - ./scripts/format.sh
    - git diff --exit-code

Update Gitlab CI config re: regen.sh changes.
Update Gitlab CI config re: regen.sh changes.

We now have to call regen.sh *before* trying to build the test suite and
examples, since we no longer commit the generated output that they use.
