language: go

go:
 - 1.8.5
 - 1.9.2
 - tip

addons:
    postgresql: "9.5"
    apt:
      packages:
        - postgresql-9.5-postgis-2.3
        - libgeos-dev
        - libprotobuf-dev
        - protobuf-compiler
        - osmosis

before_script:
  - psql -U postgres -c 'create database travis' || true
  - psql -U postgres -c "create extension if not exists postgis"
  - psql -U postgres -c "create extension if not exists hstore"

env:
  global:
    - PGUSER=postgres

install:
  - LEVELDB_VER=1.18
  - curl -fsSL https://github.com/google/leveldb/archive/v${LEVELDB_VER}.tar.gz | tar -C ${HOME} -xzf -
  - make -C ${HOME}/leveldb-${LEVELDB_VER} -j2
  - sudo mv ${HOME}/leveldb-${LEVELDB_VER}/libleveldb* /usr/lib
  - sudo cp -a ${HOME}/leveldb-${LEVELDB_VER}/include/leveldb /usr/include

script: make
