forked from icpac-igad/gsky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
64 lines (61 loc) · 2.42 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
dist: bionic
language: go
go: 1.16.3
env:
- PREFIX=$HOME/local PROJVER=6.1.1 GDALVER=3.0.1 OPENJPVER=2.3.1 NJOBS=2
services:
- postgresql
cache:
directories:
- $PREFIX
addons:
postgresql: "10"
apt:
packages:
- postgresql-10-postgis-2.4
- postgresql-10-postgis-2.4-scripts
- postgresql-client-10
- libhdf4-dev
- libhdf5-dev
- libnetcdf-dev
before_script:
- sudo service postgresql stop
- sudo rm -rf /var/lib/postgresql/10/main
- rm -rf $PGDATA
- /usr/lib/postgresql/10/bin/initdb -U $PGUSER
- mkdir -p $PREFIX/pg_socket
- /usr/lib/postgresql/10/bin/pg_ctl -o "-h ' ' -k $PGHOST" -w -t 5 start
install:
- git clone https://github.com/sstephenson/bats.git
- (cd bats && git checkout 03608115df2071fff4eaaff1605768c275e5f81f && ./install.sh $PREFIX)
- export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
- export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
- export CPPFLAGS=-I$PREFIX/include
- export CXXFLAGS=-I$PREFIX/include
- export CFLAGS=-I$PREFIX/include
- export LDFLAGS=-L$PREFIX/lib
- export PGDATA=$PREFIX/pg_data
- export PGHOST=$PREFIX/pg_socket
- export PGUSER=postgres
- >
if ! test -f $PREFIX/lib/libgdal.a ; then
wget --quiet https://github.com/uclouvain/openjpeg/archive/v${OPENJPVER}.tar.gz || exit 1
tar xf v${OPENJPVER}.tar.gz
(cd openjpeg-${OPENJPVER} && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX && make -j${NJOBS} install)
wget --quiet https://github.com/OSGeo/PROJ/releases/download/$PROJVER/proj-$PROJVER.tar.gz || exit 1
tar xf proj-$PROJVER.tar.gz
(cd proj-$PROJVER && ./configure --prefix=$PREFIX && make -j${NJOBS} install)
wget --quiet http://download.osgeo.org/gdal/$GDALVER/gdal-$GDALVER.tar.gz{,.md5} || exit 1
md5sum gdal-$GDALVER.tar.gz | cmp - gdal-$GDALVER.tar.gz.md5 || exit 1
tar xf gdal-$GDALVER.tar.gz
(cd gdal-$GDALVER && ./configure --prefix=$PREFIX && make -j${NJOBS} install)
fi
script:
- cd $TRAVIS_BUILD_DIR/mas/db && psql -f schema.sql
- cd $TRAVIS_BUILD_DIR/mas/api && psql -f mas.sql
- gofmt -d $TRAVIS_BUILD_DIR
# Ensure that gofmt -d produces zero diff output
- test -z "$(gofmt -d $TRAVIS_BUILD_DIR)"
- mkdir -p $(go env GOPATH)/src/github.com/nci
- test -d "$(go env GOPATH)/src/github.com/nci/gsky" || cp -r $TRAVIS_BUILD_DIR $(go env GOPATH)/src/github.com/nci/gsky
- cd $TRAVIS_BUILD_DIR && ./configure && make all