-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (66 loc) · 2.17 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
62
63
64
65
66
67
68
69
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
env:
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python and dependencies
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install pre-commit
run: pip install --upgrade pre-commit
- name: Cache pre-commit tools
uses: actions/cache@v4
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: ${{ hashFiles('.pre-commit-config.yaml') }}-linter-cache
- name: Run pre-commit checks
run: pre-commit run --all-files --verbose --show-diff-on-failure
test:
name: Test nanobind_example on ${{ matrix.os }} w/ Python ${{ matrix.py }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
py: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
path: nanobind-bazel
- name: Set up Python ${{ matrix.py }} on ${{ matrix.os }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Check out nanobind example repo
uses: actions/checkout@v4
with:
repository: wjakob/nanobind_example
path: nanobind_example
ref: bazel
- name: Build and test nanobind_example on ${{ matrix.os }}
run: |
python -m pip wheel . -w dist
python -m pip install --find-links=dist/ nanobind_example
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.py == '3.12'
run: |
python -m pip install --upgrade abi3audit
python -m abi3audit dist/*.whl --verbose
shell: bash
working-directory: ${{ github.workspace }}/nanobind_example