Skip to content

Commit

Permalink
test: run code coverage on push to development
Browse files Browse the repository at this point in the history
  • Loading branch information
jls5177 committed Nov 19, 2024
1 parent 6259e1a commit 67f9b23
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ name: Build
on:
pull_request:
branches: [ "development" ]
push:
branches: [ "development" ]

permissions:
contents: read
Expand Down Expand Up @@ -40,11 +42,11 @@ jobs:
- name: Validate license headers
run: |
hatch run license-check
# - name: Test
# run: |
# hatch run test-cov-xml
# - uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true
# verbose: true
- name: Test
run: |
hatch run coverage:xml
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ name: Publish Python 🐍 distribution 📦 to PyPI
on:
push:
tags:
- '*'
branches: [ "development" ]
- 'v*'
branches: [ "main" ]

jobs:
build:
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,14 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.hatch.envs.coverage]
detached = true
dependencies = [
"coverage[toml]",
]

[tool.hatch.envs.coverage.scripts]
combine = "coverage combine {args}"
html = "coverage html --skip-covered --skip-empty"
xml = "coverage xml --skip-empty"

0 comments on commit 67f9b23

Please sign in to comment.