@@ -27,102 +27,161 @@ env:
2727 PYTEST_TIMEOUT : 300
2828 # For cmake:
2929 VERBOSE : 1
30+ CMAKE_COLOR_DIAGNOSTICS : 1
3031
3132jobs :
3233 # This is the "main" test suite, which tests a large number of different
3334 # versions of default compilers and Python versions in GitHub Actions.
34- standard :
35- if : github.event.pull_request.draft == false
35+ # It is in two parts: one that always runs, and one that runs on non-draft
36+ standard-small :
37+ if : github.event.action != 'ready_for_review'
3638 strategy :
3739 fail-fast : false
3840 matrix :
39- runs-on : [ubuntu-24.04, windows-2022, macos-14]
40- python :
41- - ' 3.8'
42- - ' 3.13'
43- - ' 3.13t'
44- - ' 3.14'
45- - ' 3.14t'
46- - ' pypy-3.10'
47- - ' pypy-3.11'
48- - ' graalpy-24.2'
49-
50- # Items in here will either be added to the build matrix (if not
51- # present), or add new keys to an existing matrix element if all the
52- # existing keys match.
53- #
54- # We support an optional key: args, for cmake args
5541 include :
56- # Just add a key
5742 - runs-on : ubuntu-22.04
58- python : ' 3.8'
59- args : >
60- -DPYBIND11_FINDPYTHON=OFF
61- -DCMAKE_CXX_FLAGS="-D_=1"
62- -DPYBIND11_NUMPY_1_ONLY=ON
63- exercise_D_ : 1
43+ python-version : ' 3.8'
44+ cmake-args : -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON
45+ - runs-on : ubuntu-latest
46+ python-version : ' 3.13'
47+ cmake-args : -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
48+ - runs-on : ubuntu-latest
49+ python-version : ' 3.14t'
50+ cmake-args : -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
51+ - runs-on : ubuntu-latest
52+ python-version : ' pypy3.11'
53+ cmake-args : -DCMAKE_CXX_STANDARD=17
54+ - runs-on : ubuntu-latest
55+ python-version : ' graalpy-24.2'
56+ cmake-args : -DCMAKE_CXX_STANDARD=20
57+ - runs-on : macos-latest
58+ python-version : ' 3.14'
59+ cmake-args : -DCMAKE_CXX_STANDARD=14
6460 - runs-on : windows-2022
65- python : ' 3.8'
66- args : >
67- -DPYBIND11_FINDPYTHON=OFF
68- # Inject a Windows 2019 run
61+ python-version : ' 3.8'
62+ cmake-args : -DPYBIND11_FINDPYTHON=OFF
63+
64+
65+ name : 🐍
66+ uses : ./.github/workflows/reusable-standard.yml
67+ with :
68+ runs-on : ${{ matrix.runs-on }}
69+ python-version : ${{ matrix.python-version }}
70+ cmake-args : ${{ matrix.cmake-args }}
71+
72+ standard-large :
73+ if : github.event.pull_request.draft == false
74+ strategy :
75+ fail-fast : false
76+ matrix :
77+ include :
78+ - runs-on : ubuntu-latest
79+ python-version : ' 3.8'
80+ cmake-args : -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17
81+ - runs-on : ubuntu-latest
82+ python-version : ' 3.10'
83+ cmake-args : -DCMAKE_CXX_STANDARD=20
84+ - runs-on : ubuntu-latest
85+ python-version : ' 3.11'
86+ cmake-args : -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE" -DCMAKE_CXX_STANDARD=17
87+ - runs-on : ubuntu-latest
88+ python-version : ' 3.12'
89+ cmake-args : -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE" -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
90+ - runs-on : ubuntu-latest
91+ python-version : ' 3.13t'
92+ cmake-args : -DCMAKE_CXX_STANDARD=20 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
93+ - runs-on : ubuntu-latest
94+ python-version : ' 3.14'
95+ cmake-args : -DCMAKE_CXX_STANDARD=14
96+ - runs-on : ubuntu-latest
97+ python-version : ' pypy-3.10'
98+ cmake-args : -DCMAKE_CXX_STANDARD=14
99+ - runs-on : ubuntu-latest
100+ python-version : ' graalpy-24.1'
101+
102+ # No SciPy for macOS ARM
103+ - runs-on : macos-13
104+ python-version : ' 3.8'
105+ cmake-args : -DCMAKE_CXX_STANDARD=14
106+ - runs-on : macos-13
107+ python-version : ' 3.11'
108+ cmake-args : -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
109+ - runs-on : macos-latest
110+ python-version : ' 3.12'
111+ cmake-args : -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
112+ - runs-on : macos-13
113+ python-version : ' 3.13t'
114+ cmake-args : -DCMAKE_CXX_STANDARD=11
115+ - runs-on : macos-latest
116+ python-version : ' 3.14t'
117+ cmake-args : -DCMAKE_CXX_STANDARD=20
118+ - runs-on : macos-13
119+ python-version : ' pypy-3.10'
120+ cmake-args : -DCMAKE_CXX_STANDARD=17
121+ - runs-on : macos-latest
122+ python-version : ' pypy-3.11'
123+ - runs-on : macos-latest
124+ python-version : ' graalpy-24.2'
125+
69126 - runs-on : windows-2019
70- python : ' 3.9'
71- # Inject a few runs with different runtime libraries
127+ python-version : ' 3.9'
128+ cmake-args : -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
72129 - runs-on : windows-2022
73- python : ' 3.8'
74- args : >
75- -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
76- -DPYBIND11_NUMPY_1_ONLY=ON
130+ python-version : ' 3.8'
131+ cmake-args : -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON
77132 - runs-on : windows-2022
78- python : ' 3.9'
79- args : >
80- -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
133+ python-version : ' 3.9'
134+ cmake-args : -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14
81135 # This needs a python built with MTd
82136 # - runs-on: windows-2022
83- # python: '3.11'
84- # args: >
85- # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
137+ # python-version: '3.11'
138+ # cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
86139 - runs-on : windows-2022
87- python : ' 3.13'
88- args : >
89- -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
90- # Run tests with py::smart_holder as the default holder
91- # with recent (or ideally latest) released Python version.
92- - runs-on : ubuntu-latest
93- python : ' 3.12'
94- args : >
95- -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
96- - runs-on : macos-13
97- python : ' 3.11'
98- args : >
99- -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
100- - runs-on : macos-13
101- python : ' pypy-3.10'
140+ python-version : ' 3.10'
141+ cmake-args : -DCMAKE_CXX_FLAGS="/DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE /GR /EHsc"
102142 - runs-on : windows-2022
103- python : ' 3.10'
104- args : >
105- -DCMAKE_CXX_FLAGS="/DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE /GR /EHsc"
106- - runs-on : ' ubuntu-latest'
107- python : ' graalpy-24.1'
108-
109- exclude :
143+ python-version : ' 3.13'
144+ cmake-args : -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
145+ - runs-on : windows-latest
146+ python-version : ' 3.13t'
147+ cmake-args : -DCMAKE_CXX_STANDARD=17
148+ - runs-on : windows-latest
149+ python-version : ' 3.14'
150+ cmake-args : -DCMAKE_CXX_STANDARD=20
151+ - runs-on : windows-latest
152+ python-version : ' 3.14t'
153+ cmake-args : -DCMAKE_CXX_STANDARD=23
154+ - runs-on : windows-latest
155+ python-version : ' pypy-3.10'
156+ cmake-args : -DCMAKE_CXX_STANDARD=17
157+ - runs-on : windows-latest
158+ python-version : ' pypy3.11'
159+ cmake-args : -DCMAKE_CXX_STANDARD=20
110160 # The setup-python action currently doesn't have graalpy for windows
111161 # See https://github.com/actions/setup-python/pull/880
112- - python : ' graalpy-24.2'
113- runs-on : ' windows-2022'
114- # No SciPy for Python 3.8 ARM
115- - runs-on : macos-14
116- python : ' 3.8'
117- # No NumPy for PyPy 3.10 ARM
118- - runs-on : macos-14
119- python : ' pypy-3.10'
120- # Beta 1 broken for compiling on GHA (thinks it's free-threaded)
121- - runs-on : windows-2022
122- python : ' 3.14'
123162
163+ name : 🐍
164+ uses : ./.github/workflows/reusable-standard.yml
165+ with :
166+ runs-on : ${{ matrix.runs-on }}
167+ python-version : ${{ matrix.python-version }}
168+ cmake-args : ${{ matrix.cmake-args }}
169+
170+ # This checks inplace builds with C++11
171+ inplace :
172+ if : github.event.pull_request.draft == false
173+ strategy :
174+ fail-fast : false
175+ matrix :
176+ include :
177+ - runs-on : ubuntu-latest
178+ python : ' 3.9'
179+ - runs-on : macos-latest
180+ python : ' 3.12'
181+ - runs-on : windows-latest
182+ python : ' 3.11'
124183
125- name : " 🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }} "
184+ name : " 🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 inplace C++14 "
126185 runs-on : ${{ matrix.runs-on }}
127186
128187 steps :
@@ -134,15 +193,6 @@ jobs:
134193 python-version : ${{ matrix.python }}
135194 allow-prereleases : true
136195
137- - name : Setup Boost (Linux)
138- # Can't use boost + define _
139- if : runner.os == 'Linux' && matrix.exercise_D_ != 1
140- run : sudo apt-get install libboost-dev
141-
142- - name : Setup Boost (macOS)
143- if : runner.os == 'macOS'
144- run : brew install boost
145-
146196 - name : Install uv
147197 uses : astral-sh/setup-uv@v6
148198 with :
@@ -151,76 +201,39 @@ jobs:
151201 - name : Prepare env
152202 run : uv pip install --python=python --system -r tests/requirements.txt
153203
154- - name : Setup annotations on Linux
155- if : runner.os == 'Linux'
156- run : uv pip install --python=python --system pytest-github-actions-annotate-failures
157-
158204 # TODO Resolve Windows Ninja shared object issue on Python 3.8+
159205 - name : Use Ninja except on Windows
160206 if : runner.os != 'Windows'
161207 run : echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
162208
163- # First build - C++11 mode and inplace
164- # More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON here
165- - name : Configure C++11 ${{ matrix.args }}
209+ # More-or-less randomly adding a few extra flags here
210+ - name : Configure
166211 run : >
167212 cmake -S. -B.
168213 -DPYBIND11_WERROR=ON
169- -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
170214 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
171215 -DPYBIND11_PYTEST_ARGS=-v
172216 -DDOWNLOAD_CATCH=ON
173217 -DDOWNLOAD_EIGEN=ON
174- -DCMAKE_CXX_STANDARD=11
175- ${{ matrix.args }}
176-
177- - name : Build C++11
178- run : cmake --build .
179-
180- - name : Python tests C++11
181- run : cmake --build . --target pytest
182-
183- - name : C++11 tests
184- run : cmake --build . --target cpptest
218+ -DCMAKE_CXX_STANDARD=14
185219
186- - name : Interface test C++11
187- run : cmake --build . --target test_cmake_build
188-
189- - name : Clean directory
190- run : git clean -fdx
191-
192- # Second build - C++17 mode and in a build directory
193- # More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF here.
194- - name : Configure C++17
195- run : >
196- cmake -S. -Bbuild2 -Werror=dev
197- -DPYBIND11_WERROR=ON
198- -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
199- -DPYBIND11_PYTEST_ARGS=-v
200- -DDOWNLOAD_CATCH=ON
201- -DDOWNLOAD_EIGEN=ON
202- -DCMAKE_CXX_STANDARD=17
203- ${{ matrix.args }}
220+ # Checks to makes sure defining `_` is allowed
221+ # Triggers EHsc missing error on Windows
222+ - name : Add underscore check
223+ if : runner.os != 'Windows'
224+ run : cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1"
204225
205226 - name : Build
206- run : cmake --build build2
227+ run : cmake --build .
207228
208229 - name : Python tests
209- run : cmake --build build2 --target pytest
230+ run : cmake --build . --target pytest
210231
211- - name : C++ tests
212- run : cmake --build build2 --target cpptest
232+ - name : Compiled tests
233+ run : cmake --build . --target cpptest
213234
214235 - name : Interface test
215- run : cmake --build build2 --target test_cmake_build
216-
217- # This makes sure the setup_helpers module can build packages using
218- # setuptools
219- - name : Setuptools helpers test
220- run : |
221- uv pip install --python=python --system setuptools
222- pytest tests/extra_setuptools
223- if : matrix.runs-on != 'windows-2022'
236+ run : cmake --build . --target test_cmake_build
224237
225238
226239 manylinux :
0 commit comments