mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-12-25 23:23:21 -05:00
.travis.yml: Add OSX
This commit is contained in:
parent
408b59d522
commit
955bb214b8
12
.travis.yml
12
.travis.yml
@ -2,6 +2,7 @@ language: go
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
go:
|
||||
- 1.9.x
|
||||
@ -16,7 +17,16 @@ env:
|
||||
- MONEYGO_TEST_DB=mysql
|
||||
- MONEYGO_TEST_DB=postgres
|
||||
|
||||
# Initialize databases, if necessary
|
||||
# Install MySQL or Postgres if on OSX
|
||||
before_install:
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'mysql' ]; then brew update > /dev/null && brew install mariadb && mysql.server start; fi
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'postgres' ]; then brew update > /dev/null; fi
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'postgres' ]; then rm -rf /usr/local/var/postgres; fi
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'postgres' ]; then initdb /usr/local/var/postgres; fi
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'postgres' ]; then pg_ctl -D /usr/local/var/postgres start; fi
|
||||
- if [ $TRAVIS_OS_NAME = 'osx' ] && [ $MONEYGO_TEST_DB = 'postgres' ]; then createuser -s postgres; fi
|
||||
|
||||
# Initialize databases, if testing MySQL or Postgres
|
||||
before_script:
|
||||
- if [ $MONEYGO_TEST_DB = 'mysql' ]; then export MONEYGO_TEST_DSN="root@tcp(127.0.0.1)/moneygo_test?parseTime=true"; fi
|
||||
- if [ $MONEYGO_TEST_DB = 'postgres' ]; then export MONEYGO_TEST_DSN="postgres://postgres@localhost/moneygo_test"; fi
|
||||
|
Loading…
Reference in New Issue
Block a user