image: haskell:8.0.1

cache:
  paths:
    - .stack

before_script:
  - export STACK_ROOT=$(pwd)/.stack
  - apt-get update -qq && apt-get install -qq -y m4 libpq-dev
  - cp secrets.m4.example secrets.m4
  - make files
  - stack install hspec-discover 
  - stack install --only-dependencies
  - stack build
  # Haven't figured out how to use PostgreSQL in Gitlab CI.  
  # - psql -c 'create database betty_test;' -h postgres -U postgres

test:
  script:
    # tests will fail in the absence of PostgreSQL.
    - stack test

image: haskell:8.0.1

services:
  - postgres:9.4

variables:
  POSTGRES_DB: betty_test
  POSTGRES_USER: betty
  POSTGRES_PASSWORD: ""
  
cache:
  paths:
    - .stack

before_script:
  - export STACK_ROOT=$(pwd)/.stack
  - apt-get update -qq && apt-get install -qq -y m4 libpq-dev
  - cp secrets.m4.example secrets.m4
  - make files
  - stack install hspec-discover 
  - stack install --only-dependencies
  - stack build
  # Haven't figured out how to use PostgreSQL in Gitlab CI.  
  # - psql -c 'create database betty_test;' -h postgres -U postgres

test:
  script:
    # tests will fail in the absence of PostgreSQL.
    - stack test

Add postgres service to Gitlab CI.
Add postgres service to Gitlab CI.
