Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

ci: cut over to the intelligent+parallel pipeline in ci.yml

Tejas Chopra51af24f7bf55
diff --git a/.github/workflows/ci-fast.yml b/.github/workflows/ci-fast.yml
deleted file mode 100644
index cbb5543db..000000000
--- a/.github/workflows/ci-fast.yml
+++ /dev/null
@@ -1,190 +0,0 @@
-name: CI Fast (experimental)
-
-# Intelligent + parallel CI, running ALONGSIDE the existing ci.yml so it can be
-# validated/measured without touching required status checks. Once it's proven
-# green + faster, fold it into ci.yml and update branch protection.
-#
-# Design:
-# * changes — paths-filter: skip the heavy work for docs-only PRs.
-# * build-wheel — compile the Rust extension ONCE (maturin), share via artifact.
-# * lint — ruff + mypy, once (3.12).
-# * test — 4 parallel shards (pytest-split), each a fresh runner VM so
-# the suite's shared-state tests (repo-root db, port 8787) don't
-# collide. CPU-only torch + cached HF model keep installs fast.
-
-on:
- pull_request:
- branches: [main]
- workflow_dispatch:
-
-# Least-privilege GITHUB_TOKEN: every job here only reads the repo (checkout,
-# paths-filter, build, test). No job writes contents/PRs/releases, so read-only
-# is sufficient and satisfies the CodeQL "workflow does not contain permissions"
-# advisory.
-permissions:
- contents: read
-
-concurrency:
- group: ci-fast-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- PY_VERSION: "3.12"
- # CPU-only torch index — CI runners have no GPU; the default CUDA wheels pull
- # ~2.5 GB of nvidia libs we never use.
- PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
-
-jobs:
- changes:
- runs-on: ubuntu-latest
- outputs:
- code: ${{ steps.filter.outputs.code }}
- steps:
- - uses: actions/checkout@v4
- - uses: dorny/paths-filter@v3
- id: filter
- with:
- filters: |
- code:
- - 'headroom/**'
- - 'crates/**'
- - '**/*.rs'
- - 'pyproject.toml'
- - 'Cargo.toml'
- - 'Cargo.lock'
- - 'tests/**'
- - 'scripts/tests/**'
- - '.github/workflows/ci-fast.yml'
-
- build-wheel:
- needs: changes
- if: needs.changes.outputs.code == 'true'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ env.PY_VERSION }}
- - uses: dtolnay/[email protected]
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: ". -> target"
- - name: Build wheel once (maturin, fast CI profile)
- run: |
- python -m pip install --upgrade pip maturin
- # `--profile ci`: no LTO + parallel codegen-units → much faster compile
- # than `--release` (lto + codegen-units=1). Tests don't need the optimized ext.
- maturin build --profile ci --out dist --interpreter "python${PY_VERSION}"
- - uses: actions/upload-artifact@v4
- with:
- name: headroom-wheel
- path: dist/*.whl
- retention-days: 1
-
- lint:
- needs: changes
- if: needs.changes.outputs.code == 'true'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ env.PY_VERSION }}
- - name: Install ruff + mypy
- run: python -m pip install --upgrade pip ruff mypy
- - name: ruff check
- run: ruff check .
- - name: ruff format --check
- run: ruff format --check .
- - name: mypy
- run: mypy headroom --ignore-missing-imports
-
- # Download the embedding model ONCE and warm the shared cache, so the 4 test
- # shards don't all hammer HuggingFace in parallel (that 429'd a shard on a
- # cold cache). Uses huggingface_hub directly — no torch needed just to fetch.
- prefetch-model:
- needs: changes
- if: needs.changes.outputs.code == 'true'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ env.PY_VERSION }}
- - name: Cache HuggingFace model
- id: hfcache
- uses: actions/cache@v4
- with:
- path: ~/.cache/huggingface
- key: ${{ runner.os }}-models-allMiniLM-v2
- - name: Fetch all-MiniLM-L6-v2 (resilient to HF rate limits)
- if: steps.hfcache.outputs.cache-hit != 'true'
- env:
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
- HF_HUB_DISABLE_TELEMETRY: "1"
- run: |
- python -m pip install --upgrade pip huggingface_hub
- for i in 1 2 3 4 5 6; do
- if python -c "from huggingface_hub import snapshot_download; snapshot_download('sentence-transformers/all-MiniLM-L6-v2')"; then exit 0; fi
- echo "::warning::model fetch attempt $i failed; backing off"; sleep $((i * 30))
- done
- echo "::error::could not fetch all-MiniLM-L6-v2 from HuggingFace"; exit 1
-
- test:
- needs: [changes, build-wheel, prefetch-model]
- if: needs.changes.outputs.code == 'true'
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- shard: [1, 2, 3, 4]
- # Shards read the model purely from the cache warmed by prefetch-model — no
- # HF network calls at all (so no rate-limit HEAD requests can fail them).
- env:
- HF_HUB_OFFLINE: "1"
- TRANSFORMERS_OFFLINE: "1"
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: ${{ env.PY_VERSION }}
-
- - name: Cache pip
- uses: actions/cache@v4
- with:
- path: ~/.cache/pip
- key: ${{ runner.os }}-pipfast-${{ env.PY_VERSION }}-${{ hashFiles('pyproject.toml') }}
- restore-keys: ${{ runner.os }}-pipfast-${{ env.PY_VERSION }}-
-
- - name: Restore HuggingFace model cache (warmed by prefetch-model)
- uses: actions/cache@v4
- with:
- path: ~/.cache/huggingface
- key: ${{ runner.os }}-models-allMiniLM-v2
-
- - name: Download prebuilt wheel
- uses: actions/download-artifact@v4
- with:
- name: headroom-wheel
- path: dist
-
- - name: Install (CPU torch + prebuilt wheel + dev deps, no cargo rebuild)
- run: |
- python -m pip install --upgrade pip
- # Install torch CPU explicitly first so the extra-resolve reuses it.
- pip install torch --index-url https://download.pytorch.org/whl/cpu
- WHEEL="$(ls dist/*.whl)"
- pip install "${WHEEL}[dev]" pytest-split
- # The tests run against the repo's ./headroom source tree (they import
- # headroom AND read source files), and cwd shadows the installed wheel's
- # package — so the compiled extension from site-packages is invisible.
- # Copy the built _core.*.so into the source tree so imports resolve,
- # without a second cargo build.
- SITE="$(python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')"
- cp "${SITE}/headroom/"_core*.so headroom/
- python -c "from headroom._core import DiffCompressor; print('headroom._core OK')"
-
- - name: Run test shard ${{ matrix.shard }}/4
- run: |
- pytest tests scripts/tests \
- --splits 4 --group ${{ matrix.shard }} \
- --tb=short -q
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 46ba3b367..1cde45243 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,5 +1,16 @@
name: CI
+# Intelligent + parallel pipeline (cutover from the old 4-version matrix):
+# changes — paths-filter; skips heavy work for docs-only changes
+# build-wheel — compile the Rust ext ONCE (fast `ci` cargo profile), share via artifact
+# lint — ruff + mypy, once
+# prefetch-model — download the embedding model ONCE (authenticated), warm shared cache
+# test — 4 parallel shards (pytest-split), each a fresh runner VM; run offline
+# test-extras / test-agno / build / commitlint / workflow-validation / *-e2e — preserved
+#
+# Notes: CPU-only torch everywhere (no CUDA stack); test shards run HF_HUB_OFFLINE.
+# Multi-version (3.10/3.11/3.13) coverage on main is a planned follow-up.
+
on:
push:
branches: [main]
@@ -7,151 +18,317 @@ on:
branches: [main]
workflow_dispatch:
+permissions:
+ contents: read
+
+concurrency:
+ group: ci-${{ github.workflow }}-${{ github.ref }}
+ # Cancel superseded runs on PRs/branches, but never cancel a main build.
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+env:
+ PY_VERSION: "3.12"
+ # CPU-only torch — runners have no GPU; the default CUDA wheels pull ~2.5 GB.
+ PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu
+
jobs:
+ changes:
+ runs-on: ubuntu-latest
+ outputs:
+ code: ${{ steps.filter.outputs.code }}
+ e2e: ${{ steps.filter.outputs.e2e }}
+ workflows: ${{ steps.filter.outputs.workflows }}
+ steps:
+ - uses: actions/checkout@v4
+ - uses: dorny/paths-filter@v3
+ id: filter
+ with:
+ filters: |
+ code:
+ - 'headroom/**'
+ - 'crates/**'
+ - '**/*.rs'
+ - 'pyproject.toml'
+ - 'Cargo.toml'
+ - 'Cargo.lock'
+ - 'tests/**'
+ - 'scripts/**'
+ - '.github/workflows/ci.yml'
+ e2e:
+ - 'headroom/**'
+ - 'crates/**'
+ - 'docker/**'
+ - 'Dockerfile'
+ - 'e2e/**'
+ - 'scripts/install*'
+ - 'pyproject.toml'
+ workflows:
+ - '.github/workflows/**'
+
+ lint:
+ needs: changes
+ if: needs.changes.outputs.code == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: ${{ env.PY_VERSION }}
+ - run: python -m pip install --upgrade pip ruff mypy
+ - name: ruff check
+ run: ruff check .
+ - name: ruff format --check
+ run: ruff format --check .
+ - name: mypy
+ run: mypy headroom --ignore-missing-imports
+
+ build-wheel:
+ needs: changes
+ if: needs.changes.outputs.code == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: ${{ env.PY_VERSION }}
+ - uses: dtolnay/[email protected]
+ - uses: Swatinem/rust-cache@v2
+ with:
+ workspaces: ". -> target"
+ - name: Build wheel once (fast CI cargo profile)
+ run: |
+ python -m pip install --upgrade pip maturin
+ maturin build --profile ci --out dist --interpreter "python${PY_VERSION}"
+ - uses: actions/upload-artifact@v4
+ with:
+ name: headroom-wheel
+ path: dist/*.whl
+ retention-days: 1
+
+ prefetch-model:
+ needs: changes
+ if: needs.changes.outputs.code == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/setup-python@v5
+ with:
+ python-version: ${{ env.PY_VERSION }}
+ - name: Cache HuggingFace model
+ id: hfcache
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/huggingface
+ key: ${{ runner.os }}-models-allMiniLM-v2
+ - name: Fetch all-MiniLM-L6-v2 once (authenticated, resilient)
+ if: steps.hfcache.outputs.cache-hit != 'true'
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
+ HF_HUB_DISABLE_TELEMETRY: "1"
+ run: |
+ python -m pip install --upgrade pip huggingface_hub
+ for i in 1 2 3 4 5 6; do
+ if python -c "from huggingface_hub import snapshot_download; snapshot_download('sentence-transformers/all-MiniLM-L6-v2')"; then exit 0; fi
+ echo "::warning::model fetch attempt $i failed; backing off"; sleep $((i * 30))
+ done
+ echo "::error::could not fetch all-MiniLM-L6-v2 from HuggingFace"; exit 1
+
test:
+ needs: [changes, build-wheel, prefetch-model]
+ if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
- python-version: ["3.10", "3.11", "3.12", "3.13"]
-
+ shard: [1, 2, 3, 4]
+ env:
+ HF_HUB_OFFLINE: "1"
+ TRANSFORMERS_OFFLINE: "1"
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- # `pip install -e .` invokes maturin (declared in `[build-system]
- # requires`) under the hood, which calls cargo to build the Rust
- # extension. The toolchain has to be available before the install
- # step, otherwise build-isolation pulls maturin but `cargo` is
- # missing.
- - name: Install Rust toolchain
- uses: dtolnay/[email protected]
-
- - name: Cache cargo registry + build
- uses: Swatinem/rust-cache@v2
+ - uses: actions/setup-python@v5
with:
- workspaces: ". -> target"
+ python-version: ${{ env.PY_VERSION }}
- - name: Cache pip packages
+ - name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
- key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- restore-keys: |
- ${{ runner.os }}-pip-${{ matrix.python-version }}-
-
- - name: Install dependencies (builds Rust extension via maturin)
- run: |
- python -m pip install --upgrade pip
- pip install -e ".[dev]"
- python -c "from headroom._core import DiffCompressor; print('headroom._core OK:', DiffCompressor)"
+ key: ${{ runner.os }}-pip-${{ env.PY_VERSION }}-${{ hashFiles('pyproject.toml') }}
+ restore-keys: ${{ runner.os }}-pip-${{ env.PY_VERSION }}-
- - name: Run linting
- if: matrix.python-version == '3.12'
- run: |
- ruff check .
- ruff format --check .
+ - name: Restore HuggingFace model cache (warmed by prefetch-model)
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/huggingface
+ key: ${{ runner.os }}-models-allMiniLM-v2
- - name: Run type checking
- if: matrix.python-version == '3.12'
- run: |
- mypy headroom --ignore-missing-imports
+ - name: Download prebuilt wheel
+ uses: actions/download-artifact@v4
+ with:
+ name: headroom-wheel
+ path: dist
- - name: Run tests
+ - name: Install (CPU torch + prebuilt wheel + dev deps, no cargo rebuild)
run: |
- pytest -v --tb=short tests scripts/tests
-
- - name: Run tests with coverage
- if: matrix.python-version == '3.11'
+ python -m pip install --upgrade pip
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
+ WHEEL="$(ls dist/*.whl)"
+ pip install "${WHEEL}[dev]" pytest-split
+ # cwd's ./headroom source tree shadows the installed wheel; copy the
+ # compiled extension in so tests import it (no second cargo build).
+ SITE="$(python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')"
+ cp "${SITE}/headroom/"_core*.so headroom/
+ python -c "from headroom._core import DiffCompressor; print('headroom._core OK')"
+
+ - name: Run test shard ${{ matrix.shard }}/4
run: |
- pytest tests scripts/tests --cov=headroom --cov-report=xml --cov-report=term-missing
-
- - name: Upload coverage to Codecov
- if: matrix.python-version == '3.11'
- uses: codecov/codecov-action@v4
- with:
- file: ./coverage.xml
- fail_ci_if_error: false
+ pytest tests scripts/tests \
+ --splits 4 --group ${{ matrix.shard }} \
+ --tb=short -q
test-extras:
+ needs: [changes, build-wheel]
+ if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
+ env:
+ FASTEMBED_CACHE_PATH: ${{ github.workspace }}/.fastembed-cache
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/setup-python@v5
with:
- python-version: "3.11"
-
- - name: Install Rust toolchain
- uses: dtolnay/[email protected]
-
- - name: Cache cargo registry + build
- uses: Swatinem/rust-cache@v2
+ python-version: ${{ env.PY_VERSION }}
+ - name: Cache pip
+ uses: actions/cache@v4
with:
- workspaces: ". -> target"
-
- - name: Install with relevance extras (builds Rust extension via maturin)
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip-extras-${{ hashFiles('pyproject.toml') }}
+ restore-keys: ${{ runner.os }}-pip-extras-
+ - name: Cache fastembed model
+ uses: actions/cache@v4
+ with:
+ path: ${{ github.workspace }}/.fastembed-cache
+ key: ${{ runner.os }}-fastembed-bge-small-v1
+ - name: Download prebuilt wheel
+ uses: actions/download-artifact@v4
+ with:
+ name: headroom-wheel
+ path: dist
+ - name: Install (CPU torch + wheel[dev,relevance])
run: |
python -m pip install --upgrade pip
- pip install -e ".[dev,relevance]"
- python -c "from headroom._core import SmartCrusher; print('headroom._core OK:', SmartCrusher)"
-
- - name: Run relevance tests
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
+ WHEEL="$(ls dist/*.whl)"
+ pip install "${WHEEL}[dev,relevance]"
+ SITE="$(python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')"
+ cp "${SITE}/headroom/"_core*.so headroom/
+ python -c "from headroom._core import SmartCrusher; print('headroom._core OK')"
+ - name: Pre-fetch fastembed model (authenticated, resilient)
+ env:
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
+ HF_HUB_DISABLE_TELEMETRY: "1"
run: |
- pytest tests/test_relevance.py -v
+ for i in 1 2 3 4 5; do
+ if python -c "from fastembed import TextEmbedding; TextEmbedding('BAAI/bge-small-en-v1.5')"; then exit 0; fi
+ echo "::warning::fastembed fetch attempt $i failed; backing off"; sleep $((i * 20))
+ done
+ echo "::error::could not fetch fastembed model from HuggingFace"; exit 1
+ - name: Run relevance tests
+ run: pytest tests/test_relevance.py -v
test-agno:
+ needs: [changes, build-wheel]
+ if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/setup-python@v5
with:
- python-version: "3.11"
+ python-version: ${{ env.PY_VERSION }}
+ - name: Download prebuilt wheel
+ uses: actions/download-artifact@v4
+ with:
+ name: headroom-wheel
+ path: dist
+ - name: Install (CPU torch + wheel[dev,agno])
+ run: |
+ python -m pip install --upgrade pip
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
+ WHEEL="$(ls dist/*.whl)"
+ pip install "${WHEEL}[dev,agno]"
+ SITE="$(python -c 'import sysconfig; print(sysconfig.get_path("platlib"))')"
+ cp "${SITE}/headroom/"_core*.so headroom/
+ - name: Run agno tests
+ run: pytest tests/test_integrations/agno/ -v
- - name: Install Rust toolchain
- uses: dtolnay/[email protected]
+ commitlint:
+ if: github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Merge pull request ')
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: wagoid/commitlint-github-action@v5
+ with:
+ configFile: .commitlintrc.json
- - name: Cache cargo registry + build
- uses: Swatinem/rust-cache@v2
+ build:
+ needs: changes
+ if: needs.changes.outputs.code == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+ - uses: dtolnay/[email protected]
+ - uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
-
- - name: Install with agno extras (builds Rust extension via maturin)
+ # Smoke check that the SHIPPED build (release profile) + sdist are wired
+ # right; release.yml's matrix is what actually publishes to PyPI.
+ - name: Install build tools
run: |
python -m pip install --upgrade pip
- pip install -e ".[dev,agno]"
+ pip install 'maturin>=1.5,<2.0' twine
+ - name: Build wheel + sdist
+ run: |
+ maturin sdist --out dist
+ maturin build --release --out dist
+ - name: Check package
+ run: twine check dist/*
- - name: Run agno tests
+ workflow-validation:
+ needs: changes
+ if: needs.changes.outputs.workflows == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install actionlint
run: |
- pytest tests/test_integrations/agno/ -v
+ curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash
+ sudo mv ./actionlint /usr/local/bin/actionlint
+ - name: Install act
+ run: |
+ curl -fsSL https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
+ sudo install ./bin/act /usr/local/bin/act
+ - name: Validate workflow files
+ run: bash scripts/validate-workflows.sh
docker-native-e2e:
+ needs: changes
+ if: needs.changes.outputs.e2e == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/setup-python@v5
with:
python-version: "3.11"
-
- name: Build local Headroom image
- run: |
- docker build -t headroom-native-e2e:latest .
-
+ run: docker build -t headroom-native-e2e:latest .
- name: Run Docker-native installer e2e
env:
HEADROOM_DOCKER_IMAGE: headroom-native-e2e:latest
- run: |
- bash e2e/docker-native-install.sh
-
+ run: bash e2e/docker-native-install.sh
- name: Run Docker-native compose smoke test
env:
HEADROOM_IMAGE: headroom-native-e2e:latest
@@ -171,126 +348,47 @@ jobs:
fi
sleep 1
done
-
- name: Run Docker-native wrap e2e
run: |
docker build -f e2e/wrap/Dockerfile -t headroom-wrap-e2e .
docker run --rm headroom-wrap-e2e
-
- name: Run Docker-native init e2e
run: |
docker build -f e2e/init/Dockerfile -t headroom-init-e2e .
docker run --rm headroom-init-e2e
windows-native-wrapper:
+ needs: changes
+ if: needs.changes.outputs.e2e == 'true'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/setup-python@v5
with:
python-version: "3.12"
-
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
-
- name: Run native installer wrapper tests
- run: |
- pytest tests/test_install/test_native_installers.py -q
+ run: pytest tests/test_install/test_native_installers.py -q
macos-native-wrapper:
+ needs: changes
+ if: needs.changes.outputs.e2e == 'true'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
+ - uses: actions/setup-python@v5
with:
python-version: "3.11"
-
- name: Install bash and test dependencies
run: |
brew install bash
python -m pip install --upgrade pip
python -m pip install --retries 10 --timeout 60 pytest
-
- name: Run native installer wrapper tests
run: |
BASH_PREFIX="$(brew --prefix bash)"
export PATH="$BASH_PREFIX/bin:$PATH"
pytest tests/test_install/test_native_installers.py -q
-
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.11"
-
- - name: Install Rust toolchain
- uses: dtolnay/[email protected]
-
- - name: Cache cargo registry + build
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: ". -> target"
-
- # Single-wheel build via maturin: produces both the linux wheel and
- # the platform-independent sdist in one shot. release.yml's matrix
- # is what builds per-platform wheels for PyPI; this `build` job is
- # a smoke check that the build system is wired right.
- - name: Install build tools
- run: |
- python -m pip install --upgrade pip
- pip install 'maturin>=1.5,<2.0' twine
-
- - name: Build wheel + sdist
- run: |
- maturin sdist --out dist
- maturin build --release --out dist
-
- - name: Check package
- run: |
- twine check dist/*
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v4
- with:
- name: dist
- path: dist/
-
- commitlint:
- if: github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Merge pull request ')
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - uses: wagoid/commitlint-github-action@v5
- with:
- configFile: .commitlintrc.json
-
- workflow-validation:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
-
- - name: Install actionlint
- run: |
- curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash
- sudo mv ./actionlint /usr/local/bin/actionlint
-
- - name: Install act
- run: |
- curl -fsSL https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
- sudo install ./bin/act /usr/local/bin/act
-
- - name: Validate workflow files
- run: |
- bash scripts/validate-workflows.sh