|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v6 |
| 14 | + |
| 15 | + - name: Install uv |
| 16 | + uses: astral-sh/setup-uv@v7 |
| 17 | + |
| 18 | + - name: Set up Python |
| 19 | + run: uv python install 3.12 |
| 20 | + |
| 21 | + - name: Install dependencies |
| 22 | + run: uv sync --group dev |
| 23 | + |
| 24 | + - name: Run ruff check |
| 25 | + run: uv run ruff check src/ |
| 26 | + |
| 27 | + - name: Run ruff format check |
| 28 | + run: uv run ruff format --check src/ |
| 29 | + |
| 30 | + typecheck: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v6 |
| 34 | + |
| 35 | + - name: Install uv |
| 36 | + uses: astral-sh/setup-uv@v7 |
| 37 | + |
| 38 | + - name: Set up Python |
| 39 | + run: uv python install 3.12 |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + run: uv sync --group dev |
| 43 | + |
| 44 | + - name: Run mypy |
| 45 | + run: uv run mypy src/webstack_django_sorting |
| 46 | + |
| 47 | + test: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + strategy: |
| 50 | + fail-fast: false |
| 51 | + matrix: |
| 52 | + python-version: ["3.12", "3.13", "3.14"] |
| 53 | + django-version: ["6.0"] |
| 54 | + |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v6 |
| 57 | + |
| 58 | + - name: Install uv |
| 59 | + uses: astral-sh/setup-uv@v7 |
| 60 | + |
| 61 | + - name: Set up Python ${{ matrix.python-version }} |
| 62 | + run: uv python install ${{ matrix.python-version }} |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + run: | |
| 66 | + uv sync --group dev |
| 67 | + uv pip install "Django~=${{ matrix.django-version }}.0" |
| 68 | +
|
| 69 | + - name: Run tests |
| 70 | + working-directory: src/testproj |
| 71 | + run: uv run python manage.py test testproj |
| 72 | + |
| 73 | + coverage: |
| 74 | + runs-on: ubuntu-latest |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v6 |
| 77 | + |
| 78 | + - name: Install uv |
| 79 | + uses: astral-sh/setup-uv@v7 |
| 80 | + |
| 81 | + - name: Set up Python |
| 82 | + run: uv python install 3.14 |
| 83 | + |
| 84 | + - name: Install dependencies |
| 85 | + run: uv sync --group dev |
| 86 | + |
| 87 | + - name: Run tests with coverage |
| 88 | + working-directory: src/testproj |
| 89 | + run: | |
| 90 | + uv run coverage run manage.py test testproj |
| 91 | + uv run coverage report --fail-under=70 |
0 commit comments