Skip to content

feat: solve bug reported in the alpha feedback and added some features like the cumulative arg. #32

feat: solve bug reported in the alpha feedback and added some features like the cumulative arg.

feat: solve bug reported in the alpha feedback and added some features like the cumulative arg. #32

Workflow file for this run

name: Lint and Test
on:
pull_request:
paths:
- .github/workflows/ci.yml
- pyproject.toml
- src/**
- tests/**
defaults:
run:
shell: bash
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dev dependencies
run: uv sync --group dev
- name: Run pre-commit hooks
run: uv run pre-commit run --all-files
get-python-versions:
name: Get Python versions
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.versions.outputs.python-versions }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- name: Discover available Python versions
id: versions
run: |
min_ver=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['requires-python'])")
versions=$(
uv python list --all-versions "$min_ver" \
| grep -oP 'cpython-\K\d+\.\d+(?=\.\d+-)' \
| sort -uV \
| python3 -c "import sys, json; print(json.dumps(sys.stdin.read().split()))"
)
echo "python-versions=$versions" >> $GITHUB_OUTPUT
test:
name: Test (Python ${{ matrix.python-version }})
needs: get-python-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-versions) }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dev dependencies
run: uv sync --group dev --extra all
- name: Run tests
run: uv run pytest