| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [trunk] |
| 6 | pull_request: |
| 7 | branches: [trunk] |
| 8 | |
| 9 | concurrency: |
| 10 | group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | cancel-in-progress: true |
| 12 | |
| 13 | env: |
| 14 | UV_VERSION: "0.11.6" |
| 15 | PYTHON_VERSION: "3.11" |
| 16 | |
| 17 | jobs: |
| 18 | lint-type-test: |
| 19 | name: lint / typecheck / test |
| 20 | runs-on: ubuntu-latest |
| 21 | steps: |
| 22 | - uses: actions/checkout@v4 |
| 23 | |
| 24 | - name: Install uv |
| 25 | uses: astral-sh/setup-uv@v4 |
| 26 | with: |
| 27 | version: ${{ env.UV_VERSION }} |
| 28 | |
| 29 | - name: Set up Python |
| 30 | run: uv python install ${{ env.PYTHON_VERSION }} |
| 31 | |
| 32 | - name: Create venv and install (from PyPI, no lockfile) |
| 33 | run: | |
| 34 | uv venv --python ${{ env.PYTHON_VERSION }} |
| 35 | uv pip install --no-sources -e . |
| 36 | uv pip install pytest pytest-cov mypy ruff |
| 37 | |
| 38 | - name: Ruff lint |
| 39 | run: .venv/bin/ruff check . |
| 40 | |
| 41 | - name: Ruff format check |
| 42 | run: .venv/bin/ruff format --check . |
| 43 | |
| 44 | - name: Mypy |
| 45 | run: .venv/bin/mypy src/dlm_lsp |
| 46 | |
| 47 | - name: Pytest |
| 48 | run: .venv/bin/pytest tests/ -q |
| 49 | |
| 50 | - name: Coverage |
| 51 | run: | |
| 52 | .venv/bin/pytest tests/unit/ \ |
| 53 | --cov=src/dlm_lsp \ |
| 54 | --cov-report=term-missing \ |
| 55 | -q |
| 56 |