Skip to content
Open
Show file tree
Hide file tree
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
54 changes: 25 additions & 29 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
name: LightFM test
name: CI

on:
push:
branches:
- master
branches: [master]
pull_request:
branches:
- master
branches: [master]
workflow_dispatch:

jobs:
build:

test:
name: Test ${{ matrix.os }} / Py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.11"]
exclude:
- os: macos-latest
python-version: "3.7"
- os: windows-latest
python-version: "3.7"
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install
uv sync --all-extras --dev

- name: Build and Install LightFM
run: |
pip install -e .
- name: Test with pytest
# This triggers maturin build via pyproject.toml
uv pip install -e .

- name: Run Tests
run: |
pytest
uv run pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
venv/
.venv/
.python-version
*.pyc
*.egg*
*~
Expand All @@ -9,6 +11,7 @@ examples/quickstart/.ipynb_checkpoints/
examples/stackexchange/.ipynb_checkpoints/
build/
dist/
target/
bench/
*#*
*.7z
Expand Down
Loading