Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix coveralls #32

Merged
merged 10 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'