chore: add mypy type-check gate + type fixes; final verification clea… #5
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: test (py${{ matrix.python }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt | |
| - name: Lint (ruff) | |
| run: python -m ruff check scripts/ tests/ | |
| - name: Type check (mypy) | |
| run: python -m mypy scripts/ --ignore-missing-imports | |
| - name: Tests + coverage gate (subprocess-tracked, fail under 80%) | |
| env: | |
| COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml | |
| # pytest-cov auto-combines the parallel subprocess data and applies | |
| # fail_under (from [tool.coverage.report]); no manual combine needed. | |
| run: python -m pytest tests/ -q --cov=scripts --cov-report=term-missing | |
| - name: Release harness (evals/run_checks.py) | |
| run: python -X utf8 evals/run_checks.py | |
| - name: Build importable skill package | |
| run: python scripts/build_skill.py | |
| - name: Upload package artifact | |
| if: matrix.python == '3.12' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: chinese-fortune-skill | |
| path: dist/*.zip | |
| if-no-files-found: error |