Use current GitHub actions for CI #6
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Lint, typecheck, and test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| env: | |
| EXTERNAL_PROVIDERS_ENABLED: "false" | |
| PYTHONUNBUFFERED: "1" | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install CPU PyTorch | |
| run: python -m pip install --index-url https://download.pytorch.org/whl/cpu torch | |
| - name: Install project | |
| run: python -m pip install -e ".[dev]" | |
| - name: Ruff | |
| run: ruff check src/ tests/ | |
| - name: Mypy | |
| run: mypy src/ | |
| - name: Pytest with coverage | |
| run: pytest -q --cov=govintel --cov-report=term-missing --cov-fail-under=90 |