Skip to content

Commit

Permalink
try a different coverage approach
Browse files Browse the repository at this point in the history
  • Loading branch information
hovey committed Dec 17, 2024
1 parent 91fb141 commit 5301dea
Showing 1 changed file with 41 additions and 14 deletions.
55 changes: 41 additions & 14 deletions .github/workflows/covertest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,48 @@ jobs:
# cd ../../../
# 2024-12-17 suppress geo/ for now - stop
# ----------------------------------------
- name: Run tests with coverage
run: |
pytest cli --cov=cli > result.log; tail -n 10 result.log
- name: Generate coverage report
run: |
# pip install pytest # already installed in pyproject.toml
# pip install pytest-cov # already installed in pyproject.toml
# pytest --cov=cli/src/xyfigure --cov=geo/src/ptg --cov-report=xml
pytest cli --cov=cli/src/xyfigure --cov-report=xml
- name: Upload coverage to Codecov
# uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e
uses: codecov/[email protected]
pytest cli --cov=xyfigure --cov-report=xml --cov-report=html
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: htmlcov/

- name: Create coverage badge
run: |
pip install coverage
coverage xml
coverage-badge -o coverage.svg
- name: Upload badge
uses: actions/upload-artifact@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
directory: ./coverage/reports/
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
name: coverage-badge
path: coverage.svg

#- name: Generate coverage report
# run: |
# # pip install pytest # already installed in pyproject.toml
# # pip install pytest-cov # already installed in pyproject.toml
# # pytest --cov=cli/src/xyfigure --cov=geo/src/ptg --cov-report=xml
# pytest cli --cov=cli/src/xyfigure --cov-report=xml
#- name: Upload coverage to Codecov
## uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# directory: ./coverage/reports/
# flags: unittests
# env_vars: OS,PYTHON
# name: codecov-umbrella
# fail_ci_if_error: true

0 comments on commit 5301dea

Please sign in to comment.