image: haskell:8.2

services:
  - postgres:9.4

variables:
  POSTGRES_DB: betty_test
  POSTGRES_USER: betty
  POSTGRES_PASSWORD: betty

cache:
  untracked: true
  paths:
    - $(pwd)/.stack/

before_script:
  - export STACK_ROOT=$(pwd)/.stack
  - apt-get update -qq && apt-get install -qq -y m4 libpq-dev make
  - cp secrets.m4.example secrets.m4
  - make files
  - stack upgrade
  - stack install hspec-discover
  - stack install --only-dependencies -j 4

test:
  script:
    - export PGHOST=postgres
    - export PGUSER=$POSTGRES_USER
    - export PGPASS=$POSTGRES_PASSWORD
    - export PGDATABASE=$POSTGRES_DB
    - stack test --coverage

after_script:
  - stack hpc report betty

image: haskell:8.2

services:
  - postgres:9.4

variables:
  POSTGRES_DB: betty_test
  POSTGRES_USER: betty
  POSTGRES_PASSWORD: betty

cache:
  untracked: true
  paths:
    - $(pwd)/.stack/

before_script:
  - export STACK_ROOT=$(pwd)/.stack
  - apt-get update -qq && apt-get install -qq -y m4 libpq-dev make xz-utils
  - cp secrets.m4.example secrets.m4
  - make files
  - stack upgrade
  - stack install hspec-discover
  - stack install --only-dependencies -j 4

test:
  script:
    - export PGHOST=postgres
    - export PGUSER=$POSTGRES_USER
    - export PGPASS=$POSTGRES_PASSWORD
    - export PGDATABASE=$POSTGRES_DB
    - stack test --coverage

after_script:
  - stack hpc report betty

Install xz-utils in Gitlab CI.
Install xz-utils in Gitlab CI.

Trying to fix this error:

  $ stack hpc report betty
  Downloading lts-10.3 build plan ...
  Downloaded lts-10.3 build plan.
  Preparing to install GHC to an isolated location.
  This will not interfere with any system-level installation.
  Preparing to download ghc-8.2.2 ...
  ghc-8.2.2: download has begun
  ghc-8.2.2:    9.61 MiB / 121.89 MiB (  7.88%) downloaded...
  [...]
  Downloaded ghc-8.2.2.
  The following executables are missing and must be installed: xz
  ERROR: Job failed: exit code 1
