diff --git a/.ci/setup.sh b/.ci/setup.sh new file mode 100755 index 0000000..e0efd53 --- /dev/null +++ b/.ci/setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# configure CI environment + +# Failure is a natural part of life +set -e + +# Other packages needed for CI tasks +pip install \ + coverage \ + codecov \ + pytest-cov \ + requests diff --git a/.gitignore b/.gitignore index 943160b..7f0043c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ __pycache__/ # Others .cache *.tar.gz + +# code coverage +**/.coverage diff --git a/.travis.yml b/.travis.yml index 5365c78..0ab4166 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,16 +7,18 @@ matrix: - os: linux python: 3.6 +before_install: + - .ci/setup.sh + # Install cran-server install: - pip install . # Test cran-server script: - # Install libraries only needed by tests - - pip install requests - # Run tests - - python -m pytest + - python -m pytest --cov + - coverage report -m --fail-under=20 after_success: - echo "tests passed" + - codecov diff --git a/README.md b/README.md index ae92ef9..0c4d62e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # cran-server ![Build Status](https://travis-ci.org/UptakeOpenSource/cran-server.svg?branch=master) +[![codecov](https://codecov.io/gh/UptakeOpenSource/cran-server/branch/master/graph/badge.svg)](https://codecov.io/gh/UptakeOpenSource/cran-server) A self hosted CRAN-like R package repository.