fix CI #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branch: main | |
pull_request: | |
paths: | |
- "**.py" | |
- ".github/workflows/pytest.yml" | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
python-version: | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install UV | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: UV sync | |
run: uv sync | |
- name: Install pytest | |
run: | | |
uv tool install pytest | |
uv tool install pytest-cov | |
- uses: astral-sh/ruff-action@v3 | |
- name: Run the tests | |
run: pytest --cov --cov-report=json:coverage.json tests/ | |
- name: Extract coverage | |
run: echo "total=$(cat coverage.json | jq -r '.totals.percent_covered_display')" >> $GITHUB_ENV | |
- name: "Make badge" | |
uses: schneegans/dynamic-badges-action@v1.4.0 | |
with: | |
auth: ${{ secrets.GIST_TOKEN }} | |
gistID: 88ae1c5c4c732ba28346b3fac87b44a3 | |
filename: covbadge.json | |
label: Coverage | |
message: ${{ env.total }}% | |
minColorRange: 50 | |
maxColorRange: 90 | |
valColorRange: ${{ env.total }} |