Fix pre-commit error #24
This file contains hidden or 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: Testing Django-GC pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: self-hosted | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Run ruff (lint) | |
| run: uv run ruff check --config ruff.toml . | |
| - name: Run ruff (format check) | |
| run: uv run ruff format --check --config ruff.toml . | |
| - name: Run pyrefly (type check) | |
| run: uv run pyrefly check | |
| - name: Clean up runner artifacts | |
| if: always() | |
| run: | | |
| rm -rf .venv .pytest_cache .ruff_cache .coverage htmlcov | |
| find . -type d -name "__pycache__" -prune -exec rm -rf {} + | |
| unit-test: | |
| runs-on: self-hosted | |
| strategy: | |
| matrix: | |
| python-version: [ "3.12", "3.13", "3.14" ] | |
| fail-fast: true | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --group dev --python ${{ matrix.python-version }} | |
| - name: Run tests | |
| run: uv run --python ${{ matrix.python-version }} pytest | |
| - name: Clean up runner artifacts | |
| if: always() | |
| run: | | |
| rm -rf .venv .pytest_cache .ruff_cache .coverage htmlcov | |
| find . -type d -name "__pycache__" -prune -exec rm -rf {} + |