Skip to content

Commit

Permalink
Update github actions to produce a coverage report and attach it to t…
Browse files Browse the repository at this point in the history
…he run
  • Loading branch information
scott-carroll-verses-ai committed Jun 12, 2024
1 parent 3c46052 commit 22ca923
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,22 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest test
- name: Run tests with pytest, calculating coverage
run: coverage run --source=pymdp -m pytest test/
- name: Generate coverage HTML report
run: coverage html
# expect actions/upload-artifact@v4 to fail when run locally with `act`
- name: Upload coverage HTML report for pymdp as a build artifact
uses: actions/upload-artifact@v4
with:
name: pymdp-${{ matrix.python-version }}--coverage-report
path: htmlcov/
retention-days: 30
- name: Print coverage report to console
run: coverage report
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ __pycache__
env/
pymdp.egg-info
inferactively_pymdp.egg-info
htmlcov
.coverage

0 comments on commit 22ca923

Please sign in to comment.