| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| fetch-depth: 1 | |
| - name: "Fail on type: ignore (no suppressions allowed)" | |
| run: | | |
| if grep -rE '# type: ignore|# ty: ignore' --include='*.py' . --exclude-dir=.venv --exclude-dir=.git; then | |
| echo "::error::type: ignore / ty: ignore comments are not allowed. Fix the underlying type errors instead." | |
| exit 1 | |
| fi | |
| exit 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b | |
| with: | |
| version: "0.10.4" | |
| enable-cache: true | |
| cache-python: true | |
| - name: Format check | |
| run: uv run ruff format --check | |
| - name: Style check | |
| run: uv run ruff check | |
| - name: Type check | |
| run: uv run ty check | |
| - name: Run tests | |
| run: uv run pytest -v --tb=short | |