Add test-codecov to Makefile and travis.yml #58

This commit is contained in:
Michael Mayer 2018-11-06 16:47:17 +01:00
parent ebaa3d3622
commit 810d8a7bb5
2 changed files with 6 additions and 8 deletions

View file

@ -4,18 +4,15 @@ services:
- docker
before_script:
- docker-compose -f docker-compose.travis.yml up -d --build
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker-compose $ci_env -f docker-compose.travis.yml up -d --build
script:
- docker-compose -f docker-compose.travis.yml exec photoprism make migrate test-coverage
- docker-compose -f docker-compose.travis.yml exec photoprism make migrate test-codecov
after_script:
- docker cp $(docker-compose ps -q photoprism):/go/src/github.com/photoprism/photoprism/coverage.txt coverage.txt
- docker-compose -f docker-compose.travis.yml down
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
provider: script
script: make docker-push

View file

@ -40,9 +40,10 @@ test:
$(GOTEST) -timeout 20m -v ./internal/...
test-race:
$(GOTEST) -race -timeout 60m -v ./internal/...
test-coverage:
test-codecov:
$(GOTEST) -timeout 30m -coverprofile=coverage.txt -covermode=atomic -v ./internal/...
test-coverage-html:
bash <(curl -s https://codecov.io/bash)
test-coverage:
$(GOTEST) -timeout 30m -coverprofile=coverage.txt -covermode=atomic -v ./internal/...
$(GOTOOL) cover -html=coverage.txt -o coverage.html
clean: