language: c
cache: apt
env:
  global:
    - PG_PRELOAD=cstore_fdw
  matrix:
    - PGVERSION=9.3
before_install:
  - sudo apt-get update -qq
  - sudo update-alternatives --remove-all postmaster.1.gz
  - git clone --depth 1 https://gist.github.com/9963879.git tools
  - tools/nuke_pg.sh
install:
  - sudo apt-get install protobuf-c-compiler
  - sudo apt-get install libprotobuf-c0-dev
  - sudo locale-gen da_DK
  - sudo locale-gen da_DK.utf8
  - tools/install_pg.sh
before_script:
  - chmod 777 data
  - chmod 666 data/*
  - tools/config_and_start_cluster.sh
script: tools/pg_travis_test.sh

language: c
cache: apt
env:
  global:
    - enable_coverage=yes
    - PG_PRELOAD=cstore_fdw
  matrix:
    - PGVERSION=9.3
before_install:
  - sudo apt-get update -qq
  - sudo update-alternatives --remove-all postmaster.1.gz
  - git clone --depth 1 https://gist.github.com/9963879.git tools
  - tools/nuke_pg.sh
install:
  - sudo apt-get install protobuf-c-compiler
  - sudo apt-get install libprotobuf-c0-dev
  - sudo locale-gen da_DK
  - sudo locale-gen da_DK.utf8
  - sudo pip install cpp-coveralls
  - tools/install_pg.sh
before_script:
  - chmod 777 .
  - chmod 777 data
  - chmod 666 data/*
  - tools/config_and_start_cluster.sh
script: tools/pg_travis_test.sh
after_success:
  - sudo chmod 666 *.gcda
  - coveralls --exclude cstore.pb-c.c --exclude cstore.pb-c.h

Enable uploading coverage during Travis build
Enable uploading coverage during Travis build

Uses [cpp-coveralls][] to upload coverage information to the (free for
open source projects) [coveralls.io][]. This requires a few things:

  * Setting `enable_coverage` to `yes` to produce `gcno` files
  * Installing the coveralls command via `pip`
  * Allowing `postgres` to write `gdca` files to our checked-out code
  * Allowing our own user to read these files once created
  * Uploading the coverage data to coveralls

This is a bit ugly at the moment but hopefully this comment illuminates
what's being done. We'll clean up when we have more projects using this
service.

[cpp-coveralls]: https://github.com/eddyxu/cpp-coveralls
[coveralls.io]: https://coveralls.io/
