Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading