Skip to content

Commit

Permalink
Update coverage settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Dec 25, 2024
1 parent 8b3a255 commit 0367850
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for coverage tracking
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand All @@ -44,18 +44,42 @@ jobs:
run: |
uv sync --all-extras --group test
- name: Run tests with coverage
- name: Create report directories
run: |
uv run pytest --config-file pyproject.toml
mkdir -p tests/.reports
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Run tests with coverage
run: |
uv run pytest \
-vv \
--tb=short \
--durations=5 \
--cov=src/splitme_ai \
--cov-branch \
--cov-fail-under=0 \
--cov-report=term-missing:skip-covered \
--cov-report=json:tests/.reports/coverage.json \
--asyncio-mode=auto \
--numprocesses=auto
- name: Verify coverage report
run: |
ls -la tests/.reports/coverage.json
echo "Coverage report size: $(stat -f%z tests/.reports/coverage.json)"
echo "Coverage report content preview:"
head -n 20 tests/.reports/coverage.json
continue-on-error: true

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
files: tests/.reports/coverage.json
flags: unittests-${{ matrix.python-version }}
name: Python ${{ matrix.python-version }}
fail_ci_if_error: true
directory: tests/.reports
verbose: true

build:
name: Build Package
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ splitme-ai \
--split.settings.o examples/output-h2
```

__Example 2:__ Split on heading level 2 and generate an [mkdocs-yml] configuration file:
__Example 2:__ Split on heading level 2 and generate an [mkdocs.yml] configuration file:

```sh
splitme-ai \
Expand Down Expand Up @@ -161,17 +161,9 @@ Contributions are welcome! For bug reports, feature requests, or questions, plea
Copyright © 2024 [splitme-ai][splitme-ai]. <br />
Released under the [MIT][mit-license] license.

<!--
<div align="left">
<a href="#top">
<img src="https://raw.githubusercontent.com/eli64s/splitme-ai/216a92894e6f30c707a214fad5a5fba417e3bc39/docs/assets/button-circles.svg" alt="Return to Top" width="100px" height="100px">
</a>
</div>
-->

<div align="left">
<a href="#top">
<img src="https://img.shields.io/static/v1?label=△&message=Return&color=7934C5&style=flat-square&labelColor=1B1B1B" alt="Return to Top" width="100px">
<img src="https://raw.githubusercontent.com/eli64s/splitme-ai/216a92894e6f30c707a214fad5a5fba417e3bc39/docs/assets/button-circles.svg" alt="Return to Top" width="80px" height="80px">
</a>
</div>

Expand All @@ -194,4 +186,4 @@ Released under the [MIT][mit-license] license.
[pipx]: https://pipx.pypa.io/stable/
[uv]: https://docs.astral.sh/uv/
[mkdocs]: https://www.mkdocs.org/
[mkdocs-yml]: https://www.mkdocs.org/user-guide/configuration/
[mkdocs.yml]: https://www.mkdocs.org/user-guide/configuration/
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ omit = [
]
source = ["splitme_ai"]

[tool.coverage.json]
output = "tests/.reports/coverage.json"
pretty_print = true

[tool.pyright]
typeCheckingMode = "strict"
reportMissingTypeStubs = false
Expand Down

0 comments on commit 0367850

Please sign in to comment.