ci: work on speeding up further (#5613)

* ci: work on speeding up further

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: move uv's index-strategy to pyproject.toml

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update .github/workflows/ci.yml

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2025-04-14 17:25:32 -04:00
committed by GitHub
parent cbcc23855e
commit b3bb31ca51
7 changed files with 55 additions and 64 deletions

View File

@@ -122,33 +122,28 @@ jobs:
if: runner.os == 'macOS'
run: brew install boost
- name: Update CMake
uses: jwlawson/actions-setup-cmake@v2.0
- name: Cache wheels
if: runner.os == 'macOS'
uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# This path is specific to macOS - we really only need it for PyPy NumPy wheels
# See https://github.com/actions/cache/blob/master/examples.md#python---pip
# for ways to do this more generally
path: ~/Library/Caches/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ matrix.python }}-x64-${{ hashFiles('tests/requirements.txt') }}
enable-cache: true
- name: Prepare env
run: |
python -m pip install -r tests/requirements.txt
run: uv pip install --python=python --system -r tests/requirements.txt
- name: Setup annotations on Linux
if: runner.os == 'Linux'
run: python -m pip install pytest-github-actions-annotate-failures
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 }}
run: >
cmake -S . -B .
cmake -S. -B.
-DPYBIND11_WERROR=ON
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
@@ -159,13 +154,13 @@ jobs:
${{ matrix.args }}
- name: Build C++11
run: cmake --build . -j 2
run: cmake --build .
- name: Python tests C++11
run: cmake --build . --target pytest -j 2
run: cmake --build . --target pytest
- name: C++11 tests
run: cmake --build . --target cpptest -j 2
run: cmake --build . --target cpptest
- name: Interface test C++11
run: cmake --build . --target test_cmake_build
@@ -177,7 +172,7 @@ jobs:
# More-or-less randomly adding -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF here.
- name: Configure C++17
run: >
cmake -S . -B build2 -Werror=dev
cmake -S. -Bbuild2 -Werror=dev
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DPYBIND11_PYTEST_ARGS=-v
@@ -187,7 +182,7 @@ jobs:
${{ matrix.args }}
- name: Build
run: cmake --build build2 -j 2
run: cmake --build build2
- name: Python tests
run: cmake --build build2 --target pytest
@@ -202,7 +197,7 @@ jobs:
# setuptools
- name: Setuptools helpers test
run: |
pip install setuptools
uv pip install --python=python --system setuptools
pytest tests/extra_setuptools
if: "!(matrix.runs-on == 'windows-2022')"
@@ -913,10 +908,7 @@ jobs:
python-version: ${{ matrix.python }}
- name: Prepare env
# Ensure use of NumPy 2 (via NumPy nightlies but can be changed soon)
run: |
python3 -m pip install -r tests/requirements.txt
python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1'
run: python3 -m pip install -r tests/requirements.txt
- name: Update CMake
uses: jwlawson/actions-setup-cmake@v2.0