Apply nanobind_bazel patch via git instead #167
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and test nanobind-bazel | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
buildifier: | |
name: Lint Bazel files with buildifier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Run pre-commit checks | |
run: uvx pre-commit run --all-files --verbose --show-diff-on-failure | |
test: | |
name: Test nanobind_example on ${{ matrix.os }} w/ Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Check out nanobind example repo | |
uses: actions/checkout@v4 | |
with: | |
repository: wjakob/nanobind_example | |
path: nanobind_example | |
ref: bazel | |
- name: Override nanobind_bazel dep with local checkout in MODULE.bazel | |
run: git apply ${{github.workspace }}/nanobind_bazel_local_override.patch | |
working-directory: ${{ github.workspace }}/nanobind_example | |
- name: Build and test nanobind_example on ${{ matrix.os }} | |
# --no-sync is required so that uv does not remove the .so file again. | |
run: | | |
uv sync --no-editable | |
uv run --no-sync -- python -c "import nanobind_example; assert nanobind_example.add(1, 2) == 3" | |
working-directory: ${{ github.workspace }}/nanobind_example | |
- name: Check ${{ matrix.os }} CPython>=3.12 wheels for stable ABI violations | |
if: ${{ contains(fromJSON('["3.12", "3.13"]'), matrix.python-version) }} | |
run: | | |
uv pip install abi3audit | |
uv build --wheel | |
uv run --no-sync abi3audit dist/*.whl --verbose --summary | |
shell: bash | |
working-directory: ${{ github.workspace }}/nanobind_example |