forked from webpy/webpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
40 lines (34 loc) · 1.24 KB
/
.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
32
33
34
35
36
37
38
39
40
language: python
python:
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
services:
- mysql
- postgresql
install:
- pip install flake8 pytest-cov -r requirements.txt -r test_requirements.txt
before_script:
- if [ "$TRAVIS_PYTHON_VERSION" = "3.7" ]; then
pip install black ;
black --check . ;
fi
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- psql -c 'create database webpy;' -U postgres
- mysql --user=root -e "create user 'scott'@'localhost' identified by 'tiger'; create database webpy; grant all privileges on webpy.* to 'scott'@'localhost' with grant option;"
script:
- pytest --cov --cov-report=term-missing --cov-report=xml
- if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
pytest --doctest-modules ./web --cov-report=xml ;
fi
after_success:
- |
flags=py${TRAVIS_PYTHON_VERSION//./}
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X search -X xcode -X fix -X coveragepy -f coverage.xml -F "$flags"
notifications:
irc: irc.freenode.org#webpy