diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf9224f..237dc4f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,39 +19,28 @@ jobs: steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 - - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - name: Install uv uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff + with: + enable-cache: true + cache-dependency-glob: uv.lock - name: Create virtual environment - run: uv venv .venv + run: uv venv --python ${{ matrix.python-version }} - - name: Add venv to PATH (Linux/macOS) - if: runner.os != 'Windows' - run: | - echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV - echo "$PWD/.venv/bin" >> $GITHUB_PATH - - - name: Add venv to PATH (Windows) - if: runner.os == 'Windows' - shell: pwsh + - name: Install dependencies with CPU-only torch + shell: bash run: | - "VIRTUAL_ENV=.venv" >> $env:GITHUB_ENV - "$pwd\.venv\Scripts" >> $env:GITHUB_PATH - - - name: Install dependencies - run: make install-no-pre-commit + uv export --frozen --all-extras --no-hashes --no-emit-project \ + | grep -vE '^(nvidia-|cuda-|triton==)' > ci-requirements.txt + uv pip install -r ci-requirements.txt --torch-backend cpu + uv pip install --no-deps -e . - name: Run tests under coverage shell: bash run: | - coverage run --source=model2vec -m pytest --ignore=tests/integration - coverage report + uv run --no-sync coverage run --source=model2vec -m pytest --ignore=tests/integration + uv run --no-sync coverage report - name: Upload results to Codecov uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238