From 7b16abebb03d0c61b224b8057738d9d48887390c Mon Sep 17 00:00:00 2001 From: "w.pomp" Date: Thu, 16 Apr 2026 18:26:18 +0200 Subject: [PATCH] CI workflow --- .github/workflows/CI.yml | 38 +++++++++++++++++++++++++++++++------- Cargo.toml | 2 +- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 128d41e..2886451 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x - + - name: Cache Rust and sccache uses: actions/cache@v4 with: @@ -90,13 +90,37 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build sdist - uses: PyO3/maturin-action@v1 + - name: Cache Rust and sccache + uses: actions/cache@v4 with: - command: sdist - args: --out dist - - name: Upload sdist - uses: actions/upload-artifact@v4 + path: | + ${{ runner.temp }}/cargo + ${{ runner.temp }}/rustup + ~/.cache/pip + ~/.cache/pip-wheel + ~/.cache/sccache + key: rust-cache-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ runner.os }}-${{ github.ref }} + restore-keys: | + rust-cache-${{ matrix.platform.target }}-${{ runner.os }}- + rust-cache-${{ runner.os }}- + + - name: Install sccache and maturin + run: | + python -m pip install --upgrade pip + pip install maturin + if ! command -v sccache >/dev/null 2>&1; then + cargo install sccache || pip install sccache + fi + shell: bash + + - name: Build wheels + run: | + export CARGO_HOME="${{ runner.temp }}/cargo" + export PATH="$CARGO_HOME/bin:$PATH" + maturin sdist --out dist + + - name: Upload wheels + uses: actions/upload-artifact@v3.2.2 with: name: wheels-sdist path: dist diff --git a/Cargo.toml b/Cargo.toml index 208633b..4661528 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ indicatif = { version = "0.18", features = ["rayon"] } kmeans = "2" ndarray = "0.17" numpy = "0.28" -pyo3 = { version = "0.28", features = ["abi3-py310", "anyhow", "eyre"] } +pyo3 = { version = "0.28", features = ["abi3-py310", "anyhow", "eyre", "generate-import-lib"] } pyo3-stub-gen = "0.22" rayon = "1" thiserror = "2"