forked from pybind/pybind11
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (80 loc) · 2.49 KB
/
reusable-standard.yml
File metadata and controls
98 lines (80 loc) · 2.49 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Reusable Standard Test
on:
workflow_call:
inputs:
python-version:
required: true
type: string
cmake-args:
required: false
type: string
default: ''
runs-on:
required: true
type: string
env:
PYTHONDEVMODE: 1
PIP_BREAK_SYSTEM_PACKAGES: 1
PIP_ONLY_BINARY: numpy
FORCE_COLOR: 3
PYTEST_TIMEOUT: 300
# For cmake:
VERBOSE: 1
CMAKE_COLOR_DIAGNOSTICS: 1
jobs:
standard:
name: 🧪
runs-on: ${{ inputs.runs-on }}
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
# Python 3.13.4 broken on Windows
check-latest: >-
${{ inputs.python-version == '3.13' && runner.os == 'Windows' }}
- name: Setup Boost (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libboost-dev
- name: Setup Boost (macOS)
if: runner.os == 'macOS'
run: brew install boost
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Prepare env
run: uv pip install --python=python --system -r tests/requirements.txt
- name: Setup annotations on Linux
if: runner.os == 'Linux'
run: uv pip install --python=python --system pytest-github-actions-annotate-failures
# TODO Resolve Windows Ninja shared object issue on Python 3.8+
- name: Use Ninja except on Windows
if: runner.os != 'Windows'
run: echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
- name: Configure
run: >
cmake -S. -Bbuild -Werror=dev
-DPYBIND11_WERROR=ON
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
${{ inputs.cmake-args }}
- name: Build
run: cmake --build build
- name: Python tests
run: cmake --build build --target pytest
- name: C++ tests
timeout-minutes: 3
run: cmake --build build --target cpptest
- name: Interface test
run: cmake --build build --target test_cmake_build
- name: Visibility test
run: cmake --build build --target test_cross_module_rtti
- name: Setuptools helpers test
run: |
uv pip install --python=python --system setuptools
pytest tests/extra_setuptools