ci: list all jobs explicitly

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2025-05-30 11:26:37 -04:00
committed by Henry Schreiner
parent 5dff3354fc
commit ef2ad42d2d
3 changed files with 230 additions and 137 deletions

View File

@@ -27,102 +27,161 @@ env:
PYTEST_TIMEOUT: 300
# For cmake:
VERBOSE: 1
CMAKE_COLOR_DIAGNOSTICS: 1
jobs:
# This is the "main" test suite, which tests a large number of different
# versions of default compilers and Python versions in GitHub Actions.
standard:
# It is in two parts: one that always runs, and one that runs on non-draft
standard-small:
if: github.event.action != 'ready_for_review'
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-22.04
python-version: '3.8'
cmake-args: -DPYBIND11_FINDPYTHON=OFF -DPYBIND11_NUMPY_1_ONLY=ON
- runs-on: ubuntu-latest
python-version: '3.13'
cmake-args: -DCMAKE_CXX_STANDARD=23 -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
- runs-on: ubuntu-latest
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
- runs-on: ubuntu-latest
python-version: 'pypy3.11'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: ubuntu-latest
python-version: 'graalpy-24.2'
cmake-args: -DCMAKE_CXX_STANDARD=20
- runs-on: macos-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: windows-2022
python-version: '3.8'
cmake-args: -DPYBIND11_FINDPYTHON=OFF
name: 🐍
uses: ./.github/workflows/reusable-standard.yml
with:
runs-on: ${{ matrix.runs-on }}
python-version: ${{ matrix.python-version }}
cmake-args: ${{ matrix.cmake-args }}
standard-large:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-24.04, windows-2022, macos-14]
python:
- '3.8'
- '3.13'
- '3.13t'
- '3.14'
- '3.14t'
- 'pypy-3.10'
- 'pypy-3.11'
- 'graalpy-24.2'
# Items in here will either be added to the build matrix (if not
# present), or add new keys to an existing matrix element if all the
# existing keys match.
#
# We support an optional key: args, for cmake args
include:
# Just add a key
- runs-on: ubuntu-22.04
python: '3.8'
args: >
-DPYBIND11_FINDPYTHON=OFF
-DCMAKE_CXX_FLAGS="-D_=1"
-DPYBIND11_NUMPY_1_ONLY=ON
exercise_D_: 1
- runs-on: windows-2022
python: '3.8'
args: >
-DPYBIND11_FINDPYTHON=OFF
# Inject a Windows 2019 run
- runs-on: ubuntu-latest
python-version: '3.8'
cmake-args: -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_STANDARD=17
- runs-on: ubuntu-latest
python-version: '3.10'
cmake-args: -DCMAKE_CXX_STANDARD=20
- runs-on: ubuntu-latest
python-version: '3.11'
cmake-args: -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE" -DCMAKE_CXX_STANDARD=17
- runs-on: ubuntu-latest
python-version: '3.12'
cmake-args: -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE" -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
- runs-on: ubuntu-latest
python-version: '3.13t'
cmake-args: -DCMAKE_CXX_STANDARD=20 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
- runs-on: ubuntu-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: ubuntu-latest
python-version: 'pypy-3.10'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: ubuntu-latest
python-version: 'graalpy-24.1'
# No SciPy for macOS ARM
- runs-on: macos-13
python-version: '3.8'
cmake-args: -DCMAKE_CXX_STANDARD=14
- runs-on: macos-13
python-version: '3.11'
cmake-args: -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
- runs-on: macos-latest
python-version: '3.12'
cmake-args: -DCMAKE_CXX_STANDARD=17 -DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
- runs-on: macos-13
python-version: '3.13t'
cmake-args: -DCMAKE_CXX_STANDARD=11
- runs-on: macos-latest
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=20
- runs-on: macos-13
python-version: 'pypy-3.10'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: macos-latest
python-version: 'pypy-3.11'
- runs-on: macos-latest
python-version: 'graalpy-24.2'
- runs-on: windows-2019
python: '3.9'
# Inject a few runs with different runtime libraries
python-version: '3.9'
cmake-args: -DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
- runs-on: windows-2022
python: '3.8'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-DPYBIND11_NUMPY_1_ONLY=ON
python-version: '3.8'
cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON
- runs-on: windows-2022
python: '3.9'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
python-version: '3.9'
cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_STANDARD=14
# This needs a python built with MTd
# - runs-on: windows-2022
# python: '3.11'
# args: >
# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
# python-version: '3.11'
# cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
- runs-on: windows-2022
python: '3.13'
args: >
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
# Run tests with py::smart_holder as the default holder
# with recent (or ideally latest) released Python version.
- runs-on: ubuntu-latest
python: '3.12'
args: >
-DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
- runs-on: macos-13
python: '3.11'
args: >
-DCMAKE_CXX_FLAGS="-DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE"
- runs-on: macos-13
python: 'pypy-3.10'
python-version: '3.10'
cmake-args: -DCMAKE_CXX_FLAGS="/DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE /GR /EHsc"
- runs-on: windows-2022
python: '3.10'
args: >
-DCMAKE_CXX_FLAGS="/DPYBIND11_RUN_TESTING_WITH_SMART_HOLDER_AS_DEFAULT_BUT_NEVER_USE_IN_PRODUCTION_PLEASE /GR /EHsc"
- runs-on: 'ubuntu-latest'
python: 'graalpy-24.1'
exclude:
python-version: '3.13'
cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
- runs-on: windows-latest
python-version: '3.13t'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: windows-latest
python-version: '3.14'
cmake-args: -DCMAKE_CXX_STANDARD=20
- runs-on: windows-latest
python-version: '3.14t'
cmake-args: -DCMAKE_CXX_STANDARD=23
- runs-on: windows-latest
python-version: 'pypy-3.10'
cmake-args: -DCMAKE_CXX_STANDARD=17
- runs-on: windows-latest
python-version: 'pypy3.11'
cmake-args: -DCMAKE_CXX_STANDARD=20
# The setup-python action currently doesn't have graalpy for windows
# See https://github.com/actions/setup-python/pull/880
- python: 'graalpy-24.2'
runs-on: 'windows-2022'
# No SciPy for Python 3.8 ARM
- runs-on: macos-14
python: '3.8'
# No NumPy for PyPy 3.10 ARM
- runs-on: macos-14
python: 'pypy-3.10'
# Beta 1 broken for compiling on GHA (thinks it's free-threaded)
- runs-on: windows-2022
python: '3.14'
name: 🐍
uses: ./.github/workflows/reusable-standard.yml
with:
runs-on: ${{ matrix.runs-on }}
python-version: ${{ matrix.python-version }}
cmake-args: ${{ matrix.cmake-args }}
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
# This checks inplace builds with C++11
inplace:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
python: '3.9'
- runs-on: macos-latest
python: '3.12'
- runs-on: windows-latest
python: '3.11'
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 inplace C++14"
runs-on: ${{ matrix.runs-on }}
steps:
@@ -134,15 +193,6 @@ jobs:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Setup Boost (Linux)
# Can't use boost + define _
if: runner.os == 'Linux' && matrix.exercise_D_ != 1
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@v6
with:
@@ -151,76 +201,39 @@ jobs:
- 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"
# First build - C++11 mode and inplace
# More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON here
- name: Configure C++11 ${{ matrix.args }}
# More-or-less randomly adding a few extra flags here
- name: Configure
run: >
cmake -S. -B.
-DPYBIND11_WERROR=ON
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
${{ matrix.args }}
-DCMAKE_CXX_STANDARD=14
- name: Build C++11
run: cmake --build .
- name: Python tests C++11
run: cmake --build . --target pytest
- name: C++11 tests
run: cmake --build . --target cpptest
- name: Interface test C++11
run: cmake --build . --target test_cmake_build
- name: Clean directory
run: git clean -fdx
# Second build - C++17 mode and in a build directory
# More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF here.
- name: Configure C++17
run: >
cmake -S. -Bbuild2 -Werror=dev
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DPYBIND11_PYTEST_ARGS=-v
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
${{ matrix.args }}
# Checks to makes sure defining `_` is allowed
# Triggers EHsc missing error on Windows
- name: Add underscore check
if: runner.os != 'Windows'
run: cmake -S. -B. -DCMAKE_CXX_FLAGS="-D_=1"
- name: Build
run: cmake --build build2
run: cmake --build .
- name: Python tests
run: cmake --build build2 --target pytest
run: cmake --build . --target pytest
- name: C++ tests
run: cmake --build build2 --target cpptest
- name: Compiled tests
run: cmake --build . --target cpptest
- name: Interface test
run: cmake --build build2 --target test_cmake_build
# This makes sure the setup_helpers module can build packages using
# setuptools
- name: Setuptools helpers test
run: |
uv pip install --python=python --system setuptools
pytest tests/extra_setuptools
if: matrix.runs-on != 'windows-2022'
run: cmake --build . --target test_cmake_build
manylinux:

80
.github/workflows/reusable-standard.yml vendored Normal file
View File

@@ -0,0 +1,80 @@
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
jobs:
standard:
name: 🧪
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
- 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@v6
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
run: cmake --build build --target cpptest
- name: Interface test
run: cmake --build build --target test_cmake_build
- name: Setuptools helpers test
run: |
uv pip install --python=python --system setuptools
pytest tests/extra_setuptools