Skip to content

Commit

Permalink
Merge 5333503 into 0d6b505
Browse files Browse the repository at this point in the history
  • Loading branch information
rossengeorgiev committed Jan 19, 2021
2 parents 0d6b505 + 5333503 commit 3e67c18
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Docs: https://coverage.readthedocs.org/en/latest/config.html

[run]
branch = False

# If True, stores relative file paths in data file (needed for Github Actions).
# Using this parameter requires coverage>=5.0
relative_files = True
29 changes: 22 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,38 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python Env
uses: actions/setup-python@v2.1.4 # FIXME: Use "v2" tag once https://github.com/actions/setup-python/issues/171 is resolved.
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
pip install mock pytest==3.2.1 pytest-cov==2.5.1
pip install coveralls
make init
- name: Run Tests
env:
PYTHONHASHSEED: "0"
run: |
pytest --cov=vdf tests
- name: Coveralls
make test
- name: Upload to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "${{ matrix.os }}_${{ matrix.python-version }}"
run: |
coveralls
coveralls --service=github
coveralls:
name: Finish Coveralls
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Install coveralls
run: |
pip3 install --upgrade coveralls
- name: Send coverage finish to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --finish
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ init:

test:
rm -f .coverage vdf/*.pyc tests/*.pyc
PYTHONHASHSEED=0 python -m pytest --cov=vdf tests
PYTHONHASHSEED=0 python -m pytest --tb=short --cov-config .coveragerc --cov=vdf tests

pylint:
pylint -r n -f colorized vdf || true
Expand Down
9 changes: 7 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
mock
pytest
pytest-cov

coverage>=5.0; python_version == '2.7' or python_version >= '3.5'
pytest-cov>=2.7.0; python_version == '2.7' or python_version >= '3.5'

# coveralls 2.0 has removed support for Python 2.7 and 3.4
git+https://github.com/andy-maier/coveralls-python.git@andy/add-py27#egg=coveralls; python_version == '2.7'
coveralls>=2.1.2; python_version >= '3.5'

0 comments on commit 3e67c18

Please sign in to comment.