Skip to content

Commit

Permalink
.travis.yml: Coverage results via codecov
Browse files Browse the repository at this point in the history
- Use Makefile for CI builds
- Show coverage results from codecov in CI
- Remove CRLF in .coverage.yml
  • Loading branch information
abh3po committed Dec 20, 2016
1 parent a017909 commit 8584852
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
comment: false
coverage:
status:
changes: false
patch: false
project:
default:
enabled: true
target: 100%
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi

before_script:
- pip3 install -r test-requirements.txt
- make test-install

script:
- python3 setup.py install
- coala-ci
- pytest
- make install
- make lint
- make test

after_success:
- bash <(curl -s https://codecov.io/bash)

matrix:
include:
Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
PYTHON = python3
PIP = pip3
TEST_PATH = ./tests/
SETUP_FILE = setup.py
MODULE_NAME = UIP
TEST_REQUIREMENTS = test-requirements.txt

clean-pyc:
find . -name '__pycache__' \
-exec rm --force --recursive {} +
-exec rm -rf {} +
find . -name '*~' \
-exec rm --force {} +
-exec rm -rf {} +

clean-build:
rm --force --recursive build/
rm --force --recursive dist/
rm --force --recursive UIP.egg-info/
rm --force --recursive .cache/
rm --force .coverage
rm -rf build/
rm -rf dist/
rm -rf UIP.egg-info/
rm -rf .cache/
rm -f .coverage

clean: clean-pyc clean-build

Expand All @@ -25,9 +25,11 @@ install: clean-pyc
uninstall: clean-pyc
$(PIP) uninstall $(MODULE_NAME)

test-install: clean
$(PIP) install --requirement $(TEST_REQUIREMENTS)

test:
pytest --cov --verbose --color=yes $(TEST_PATH)
rm .coverage
pytest

lint:
coala --non-interactive
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[pytest]
testpaths=tests/
addopts='--cov'

1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest==3.0.4
coala==0.9.0
coala-bears==0.9.1
pytest-cov==2.4.0

0 comments on commit 8584852

Please sign in to comment.