Browse Source

Use makefile for CI, so its easier to replicate locally.

Willem van Bergen 10 years ago
parent
commit
db8795b655
2 changed files with 35 additions and 11 deletions
  1. 11 11
      .travis.yml
  2. 24 0
      Makefile

+ 11 - 11
.travis.yml

@@ -6,8 +6,9 @@ go:
 
 env:
   global:
-  - KAFKA_PEERS="localhost:6667,localhost:6668,localhost:6669,localhost:6670,localhost:6671"
-  - KAFKA_INSTALL_ROOT=/home/travis/kafka KAFKA_HOSTNAME=localhost
+  - KAFKA_PEERS=localhost:6667,localhost:6668,localhost:6669,localhost:6670,localhost:6671
+  - KAFKA_INSTALL_ROOT=/home/travis/kafka
+  - KAFKA_HOSTNAME=localhost
   matrix:
   - KAFKA_VERSION=0.8.1.1
   - KAFKA_VERSION=0.8.2.1
@@ -17,17 +18,16 @@ before_install:
 - vagrant/install_cluster.sh
 - vagrant/boot_cluster.sh
 - vagrant/create_topics.sh
-- go get golang.org/x/tools/cmd/vet
-- go get github.com/kisielk/errcheck
 
-script:
-- go test -v -race ./...
-- go vet ./...
-- errcheck github.com/Shopify/sarama/...
-- if [[ -n $(go fmt ./...) ]]; then echo "Please run go fmt on your code." && exit 1; fi
 
-notifications:
-  flowdock: 15e08f7ed3a8fd2d89ddb36435301c1a
+install:
+- make install_dependencies
+
+script:
+- make test
+- make vet
+- make errcheck
+- make fmt
 
 matrix:
   allow_failures:

+ 24 - 0
Makefile

@@ -0,0 +1,24 @@
+default: fmt vet errcheck test
+
+test:
+	go test -v -race ./...
+
+vet:
+	go vet ./...
+
+errcheck:
+	errcheck github.com/Shopify/sarama/...
+
+fmt:
+	@if [[ -n $$(go fmt ./...) ]]; then echo 'Please run go fmt on your code.' && exit 1; fi
+
+install_dependencies: install_errcheck install_go_vet get
+
+install_errcheck:
+	go get github.com/kisielk/errcheck
+
+install_go_vet:
+	go get golang.org/x/tools/cmd/vet
+
+get:
+	go get