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

Add coverage push to Codacy #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
strategy:
matrix:
python-version: [3.9, 3.8, 3.7, 3.6]
env:
IS_COVERAGE_ALLOWED: ${{ secrets.CODACY_PROJECT_TOKEN != '' }}
IS_MASTER_BRANCH: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -29,7 +32,13 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements-test.txt
- name: Test with pytest
run: pytest -v tests/
run: pytest --cov-report xml --cov=algobot tests/
- name: Upload coverage
if: ${{ matrix.python-version == 3.9 && env.IS_COVERAGE_ALLOWED == 'true' && env.IS_MASTER_BRANCH == 'true' }}
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
lint:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ __pycache__/
/.venv/
/venv/

# Coverage
/.coverage
/coverage.xml

# Project
/Backtest Results/
/Configuration/
Expand Down
5 changes: 3 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-r requirements.txt
pytest==6.2.2
pytest==6.2.3
pytest-cov==2.11.1
flake8==3.9.0
pre-commit==2.11.1
pre-commit==2.12.0