diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d16619a..52a9532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - uv-resolution: ['highest', 'lowest'] + uv-resolution: ['highest', 'lowest-direct'] # The minimum version should be represented in pyproject.toml. python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest, windows-latest] @@ -26,51 +26,33 @@ jobs: steps: - uses: actions/checkout@v4 - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: "Install uv" - run: "pip install --upgrade uv" - - name: "Create virtual environment" - id: venv - run: | - if [ "${{ matrix.os }}" = "windows-latest" ]; then - uv venv C:/Users/runner/.venv - echo "activate=C:/Users/runner/.venv/Scripts/Activate.ps1" >> "$GITHUB_OUTPUT" - else - uv venv /home/runner/.venv - echo "activate=source /home/runner/.venv/bin/activate" >> "$GITHUB_OUTPUT" - fi - shell: bash + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + cache-dependency-glob: '**/pyproject.toml' - name: "Install dependencies" run: | - ${{ steps.venv.outputs.activate }} - # We want the latest dev requirements, but the lowest install requirements. - uv pip install --upgrade --editable .[dev] - uv pip install --resolution=${{ matrix.uv-resolution }} --upgrade --editable . + uv sync --python=${{ matrix.python-version }} --all-extras --resolution=${{ matrix.uv-resolution }} - name: "Lint" run: | - ${{ steps.venv.outputs.activate }} - mypy . - ruff check . - ruff format --check . - pip-extra-reqs pip_check_reqs - pip-missing-reqs pip_check_reqs - pylint pip_check_reqs tests - pyroma --min=10 . - pyproject-fmt --check . - pyright . - actionlint + uv run mypy . + uv run ruff check . + uv run ruff format --check . + uv run pip-extra-reqs pip_check_reqs + uv run pip-missing-reqs pip_check_reqs + uv run pylint pip_check_reqs tests + uv run pyroma --min=10 . + uv run pyproject-fmt --check . + uv run pyright . + uv run actionlint - name: "Run tests" run: | - ${{ steps.venv.outputs.activate }} - pytest -s -vvv --cov-fail-under 100 --cov=pip_check_reqs/ --cov=tests tests/ --cov-report=xml + uv run pytest -s -vvv --cov-fail-under 100 --cov=pip_check_reqs/ --cov=tests tests/ --cov-report=xml completion-ci: needs: build