diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 24c58159..466cdef1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -39,30 +39,27 @@ jobs: - name: Check out code uses: actions/checkout@v7 - - name: Set up Python - uses: actions/setup-python@v6 + - name: Install uv + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: - python-version: ${{ matrix.python-version }} + enable-cache: true + # Install from uv.lock so CI uses the same pinned versions as local dev + # (`--frozen` fails loudly if the lockfile drifts from pyproject.toml + # instead of silently resolving a new upstream release). - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install -e . + run: uv sync --extra dev --frozen --python ${{ matrix.python-version }} - name: Test CUDA auto-detection (skips if no GPU) - run: | - pytest tests/comfy_cli/test_cuda_detect_real.py -v + run: uv run --frozen --extra dev --python ${{ matrix.python-version }} pytest tests/comfy_cli/test_cuda_detect_real.py -v - name: Test e2e env: PYTHONPATH: ${{ github.workspace }} TEST_E2E: true - run: | - pytest tests/e2e + run: uv run --frozen --extra dev --python ${{ matrix.python-version }} pytest tests/e2e - name: Test torch backend compilation env: TEST_TORCH_BACKEND: "true" - run: | - pytest tests/uv/test_torch_backend_compile.py -xvs + run: uv run --frozen --extra dev --python ${{ matrix.python-version }} pytest tests/uv/test_torch_backend_compile.py -xvs diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c0d45cca..f4fcc072 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -20,22 +20,22 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up Python - uses: actions/setup-python@v6 + - name: Install uv + uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 with: - python-version: '3.10' # Follow the min version in pyproject.toml + enable-cache: true + # Install from uv.lock so CI uses the same pinned versions as local dev + # (`--frozen` fails loudly if the lockfile drifts from pyproject.toml + # instead of silently resolving a new upstream release). `--python 3.10` + # follows the min version in pyproject.toml. - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest pytest-cov jsonschema - pip install -e . + run: uv sync --extra dev --frozen --python 3.10 - name: Run tests env: PYTHONPATH: ${{ github.workspace }} - run: | - pytest --cov=comfy_cli --cov-report=xml . + run: uv run --frozen --extra dev --python 3.10 pytest --cov=comfy_cli --cov-report=xml . - name: Upload coverage to Codecov uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2