Skip to content

Commit 004ff13

Browse files
author
Philippe Lafoucrière
committed
Add docker config to run tests
1 parent 6c5294f commit 004ff13

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: go
2+
sudo: required
3+
4+
go:
5+
- 1.6
6+
- 1.7
7+
8+
go_import_path: github.com/db-journey/migrate
9+
10+
services:
11+
- docker
12+
13+
before_install:
14+
- sed -i -e 's/golang/golang:'"$TRAVIS_GO_VERSION"'/' docker-compose.yml
15+
16+
script: make test

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DCR=docker-compose run --rm
2+
.PHONY: test
3+
4+
all: test
5+
6+
test:
7+
$(DCR) go-test

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
go: &go
2+
image: golang
3+
working_dir: /go/src/github.com/db-journey/mysql-driver
4+
volumes:
5+
- $GOPATH:/go
6+
go-test:
7+
<<: *go
8+
command: sh -c 'go get -t -v ./... && go test -p=1 -v ./...'
9+
links:
10+
- mysql
11+
mysql:
12+
image: mysql
13+
environment:
14+
MYSQL_DATABASE: migratetest
15+
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

0 commit comments

Comments
 (0)