-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hellofresh/feature/add-travis-file
Add travis file
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
language: go | ||
|
||
services: | ||
- docker | ||
|
||
go: | ||
- "1.x" | ||
- "1.8" | ||
- "1.9" | ||
- "1.10" | ||
|
||
before_install: | ||
- docker-compose up -d | ||
|
||
install: | ||
- mkdir -p $GOPATH/bin | ||
- make deps | ||
|
||
script: | ||
- make all | ||
|
||
after_script: | ||
- docker-compose down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
all: lint test | ||
OK_COLOR=\033[32;01m | ||
NO_COLOR=\033[0m | ||
|
||
all: deps lint test checks | ||
|
||
lint: | ||
@echo "$(OK_COLOR)==> Linting... $(NO_COLOR)" | ||
@go vet ./... | ||
|
||
test: | ||
@go test -v -cover ./... | ||
|
||
deps: | ||
@echo "$(OK_COLOR)==> Installing dependencies $(NO_COLOR)" | ||
@go get -u gopkg.in/mgo.v2 | ||
@go get -u github.com/go-sql-driver/mysql | ||
@go get -u github.com/lib/pq | ||
@go get -u github.com/streadway/amqp | ||
@go get -u github.com/garyburd/redigo/redis | ||
|
||
checks: | ||
@docker-compose up -d | ||
@sleep 3 | ||
@echo "Running checks tests against container deps" && \ | ||
@echo "$(OK_COLOR)==> Running checks tests against container deps $(NO_COLOR)" && \ | ||
HEALTH_GO_PG_DSN="postgres://test:test@`docker-compose port postgres 5432`/test?sslmode=disable" \ | ||
HEALTH_GO_MQ_DSN="amqp://guest:guest@`docker-compose port rabbit 5672`/" \ | ||
HEALTH_GO_RD_DSN="redis://`docker-compose port redis 6379`/" \ | ||
HEALTH_GO_MG_DSN="`docker-compose port mongo 27017`/" \ | ||
HEALTH_GO_MS_DSN="test:test@tcp(`docker-compose port mysql 3306`)/test?charset=utf8" \ | ||
go test -v -cover ./... | ||
|
||
.PHONY: all test lint checks | ||
.PHONY: all deps test lint checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters