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
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

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

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
PYTHON_VERSION: "3.12"
CARGO_TERM_COLOR: always

jobs:
lint:
name: Lint (ruff + mypy)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dev dependencies
run: pip install -e ".[dev]" --no-build-isolation
Comment on lines +22 to +29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Lint job will fail: missing Rust toolchain for the editable install.

Since this is a maturin-based project, pip install -e ".[dev]" --no-build-isolation invokes cargo to build the Rust extension. The lint job never sets up a Rust toolchain, so the install step will error out with a missing cargo/rustc. The test job handles this correctly (Lines 54-56).

🐛 Proposed fix — add Rust toolchain and cache before the install
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ env.PYTHON_VERSION }}
 
+      - uses: dtolnay/rust-toolchain@stable
+
+      - uses: Swatinem/rust-cache@v2
+
       - name: Install dev dependencies
         run: pip install -e ".[dev]" --no-build-isolation
🤖 Prompt for AI Agents
In @.github/workflows/ci.yml around lines 22 - 29, The lint job fails because
the "Install dev dependencies" step runs pip install -e ".[dev]"
--no-build-isolation which requires the Rust toolchain; update the workflow to
set up Rust before that step by adding a rust toolchain setup (e.g.,
actions-rs/toolchain or rust-lang/setup) and the Rust cargo cache similar to the
test job's toolchain/cache lines, ensuring the rust toolchain setup and cache
steps run prior to the "Install dev dependencies" step so cargo/rustc are
available for building the maturin-based extension.


- name: Ruff check
run: ruff check .

- name: Ruff format check
run: ruff format --check .

- name: Mypy
run: mypy .

test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Install package with dev deps
run: pip install -e ".[dev]" --no-build-isolation

- name: Run tests
run: pytest tests/ -v

rust:
name: Rust (check + clippy + fmt)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- uses: Swatinem/rust-cache@v2

- name: Cargo check
run: cargo check

- name: Clippy
run: cargo clippy -- -D warnings

- name: Rustfmt
run: cargo fmt --check
Loading