-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
31 lines (23 loc) · 1016 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
language: python
python:
- "3.6"
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
sudo: required
services:
- docker
install:
- pip install -r dev-requirements.txt
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- python -m pytest --cov=hanako --cov-report xml:coverage-report.xml -s tests/
after_script:
- if [ -f "coverage-report.xml" ]; then sed 's|<source>.*/hanako</source>|<source>hanako</source>|' coverage-report.xml > coverage.xml; fi && ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
after_success:
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ]; then docker build -t hanako/hanako:latest -f docker/Dockerfile . && echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && docker push hanako/hanako:latest ; fi