diff --git a/.gitignore b/.gitignore index 120d4c05..321b0d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -cover.out -cover.html +coverage.txt +coverage.html test-bdd/*.xml bin bin/* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..b1c432ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: go + +go: +- "1.12.5" + +env: + - GO111MODULE=on + +jobs: + include: + - stage: unit-test + script: + - make test + - bash <(curl -s https://codecov.io/bash) + - stage: publish-image + if: type = push + env: + - IMG=orkaproj/instance-manager:$TRAVIS_BRANCH + script: + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - make docker-build + - make docker-push diff --git a/Makefile b/Makefile index 1fb87fb8..10e855b9 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,11 @@ all: manager # Run tests test: generate fmt vet manifests - go test -v ./controllers/... -coverprofile cover.out + go test -v ./controllers/... -coverprofile coverage.txt # Run verbose tests vtest: generate fmt vet manifests - go test -v ./controllers/... -coverprofile cover.out --logging-enabled + go test -v ./controllers/... -coverprofile coverage.txt --logging-enabled bdd: go test -timeout 60m -v ./test-bdd/ -ginkgo.v -ginkgo.progress --ginkgo.failFast \ @@ -28,8 +28,8 @@ bdd: --subnets ${SUBNETS} coverage: - go test -coverprofile cover.out -v ./controllers/... - go tool cover -html=cover.out -o cover.html + go test -coverprofile coverage.txt -v ./controllers/... + go tool cover -html=coverage.txt -o coverage.html # Build manager binary manager: generate fmt vet diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..e975e14c --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +coverage: + range: "70...90" \ No newline at end of file