-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (58 loc) · 2.04 KB
/
lint-and-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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@v4
- 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.8, 3.9, "3.10", 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
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: Patch nanobind_example stubgen target
run: git apply ${{github.workspace }}/stubgen.patch
working-directory: ${{ github.workspace }}/nanobind_example
- name: Override nanobind_bazel pin in MODULE.bazel
run: python fixup_module_bazel.py ${{ github.workspace}}/nanobind_example
- name: Build and test nanobind_example on ${{ matrix.os }}
run: |
uv sync --no-editable
uv run 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: matrix.python-version >= 3.12
run: |
uv pip install abi3audit
uv build --wheel -o dist
uv run -m abi3audit dist/*.whl --verbose --summary
shell: bash
working-directory: ${{ github.workspace }}/nanobind_example