Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: try some speedups #5151

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 44 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ jobs:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: Use the mold linker (Linux)
if: runner.os == 'Linux'
uses: rui314/setup-mold@v1

- name: Setup Boost (Linux)
# Can't use boost + define _
if: runner.os == 'Linux' && matrix.python != '3.6'
Expand Down Expand Up @@ -127,15 +131,15 @@ jobs:
${{ matrix.args }}

- name: Build C++11
run: cmake --build . -j 2
run: cmake --build . -j 4

- name: Python tests C++11
run: cmake --build . --target pytest -j 2
run: cmake --build . --target pytest -j 4

- name: C++11 tests
# TODO: Figure out how to load the DLL on Python 3.8+
if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == 'pypy-3.8'))"
run: cmake --build . --target cpptest -j 2
run: cmake --build . --target cpptest -j 4

- name: Interface test C++11
run: cmake --build . --target test_cmake_build
Expand All @@ -158,7 +162,7 @@ jobs:
${{ matrix.args }}

- name: Build
run: cmake --build build2 -j 2
run: cmake --build build2 -j 4

- name: Python tests
run: cmake --build build2 --target pytest
Expand All @@ -180,7 +184,7 @@ jobs:
${{ matrix.args }}

- name: Build (unstable ABI)
run: cmake --build build3 -j 2
run: cmake --build build3 -j 4

- name: Python tests (unstable ABI)
run: cmake --build build3 --target pytest
Expand Down Expand Up @@ -270,7 +274,7 @@ jobs:
mv valgrind-$VALGRIND_VERSION valgrind
cd valgrind
./configure
make -j 2 > /dev/null
make -j 4 > /dev/null

- name: Install Valgrind
if: matrix.valgrind
Expand All @@ -294,7 +298,7 @@ jobs:
-DCMAKE_CXX_STANDARD=17

- name: Build
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build --target pytest
Expand Down Expand Up @@ -363,7 +367,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build --target pytest
Expand Down Expand Up @@ -430,7 +434,7 @@ jobs:
# cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
#
# - name: Build
# run: cmake --build build -j 2 --verbose
# run: cmake --build build -j 4 --verbose
#
# - name: Python tests
# run: cmake --build build --target pytest
Expand Down Expand Up @@ -481,7 +485,7 @@ jobs:
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp"

- name: Build
run: cmake --build build -j 2 --verbose
run: cmake --build build -j 4 --verbose

- name: Python tests
run: cmake --build build --target pytest
Expand Down Expand Up @@ -534,7 +538,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build --target pytest
Expand All @@ -558,7 +562,7 @@ jobs:

- name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE
if: matrix.gcc == '12'
run: cmake --build build_partial -j 2
run: cmake --build build_partial -j 4

- name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
if: matrix.gcc == '12'
Expand Down Expand Up @@ -608,7 +612,7 @@ jobs:
- name: Build C++11
run: |
set +e; source /opt/intel/oneapi/setvars.sh; set -e
cmake --build build-11 -j 2 -v
cmake --build build-11 -j 4 -v

- name: Python tests C++11
run: |
Expand Down Expand Up @@ -640,7 +644,7 @@ jobs:
- name: Build C++17
run: |
set +e; source /opt/intel/oneapi/setvars.sh; set -e
cmake --build build-17 -j 2 -v
cmake --build build-17 -j 4 -v

- name: Python tests C++17
run: |
Expand Down Expand Up @@ -715,7 +719,7 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build --target pytest
Expand Down Expand Up @@ -766,7 +770,7 @@ jobs:
working-directory: /build-tests

- name: Python tests
run: make pytest -j 2
run: make pytest -j 4
working-directory: /build-tests


Expand Down Expand Up @@ -859,7 +863,7 @@ jobs:
-DDOWNLOAD_EIGEN=ON
${{ matrix.args }}
- name: Build C++11
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build -t pytest
Expand Down Expand Up @@ -913,7 +917,7 @@ jobs:
-DDOWNLOAD_EIGEN=ON
${{ matrix.args }}
- name: Build C++11
run: cmake --build build --config Debug -j 2
run: cmake --build build --config Debug -j 4

- name: Python tests
run: cmake --build build --config Debug -t pytest
Expand Down Expand Up @@ -955,13 +959,13 @@ jobs:
-DCMAKE_CXX_STANDARD=20

- name: Build C++20
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests
run: cmake --build build --target pytest

- name: C++20 tests
run: cmake --build build --target cpptest -j 2
run: cmake --build build --target cpptest -j 4

- name: Interface test C++20
run: cmake --build build --target test_cmake_build
Expand All @@ -976,7 +980,7 @@ jobs:
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"

- name: Build C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: cmake --build build_partial -j 2
run: cmake --build build_partial -j 4

- name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: cmake --build build_partial --target pytest
Expand Down Expand Up @@ -1028,13 +1032,13 @@ jobs:
-S . -B build

- name: Build C++11
run: cmake --build build -j 2
run: cmake --build build -j 4

- name: Python tests C++11
run: cmake --build build --target pytest -j 2
run: cmake --build build --target pytest -j 4

- name: C++11 tests
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 2
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target cpptest -j 4

- name: Interface test C++11
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build
Expand All @@ -1049,13 +1053,13 @@ jobs:
-S . -B build2

- name: Build C++14
run: cmake --build build2 -j 2
run: cmake --build build2 -j 4

- name: Python tests C++14
run: cmake --build build2 --target pytest -j 2
run: cmake --build build2 --target pytest -j 4

- name: C++14 tests
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 2
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target cpptest -j 4

- name: Interface test C++14
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build
Expand All @@ -1070,13 +1074,13 @@ jobs:
-S . -B build3

- name: Build C++17
run: cmake --build build3 -j 2
run: cmake --build build3 -j 4

- name: Python tests C++17
run: cmake --build build3 --target pytest -j 2
run: cmake --build build3 --target pytest -j 4

- name: C++17 tests
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 2
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target cpptest -j 4

- name: Interface test C++17
run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build
Expand Down Expand Up @@ -1136,16 +1140,16 @@ jobs:
-DCMAKE_CXX_STANDARD=17

- name: Build
run: cmake --build . -j 2
run: cmake --build . -j 4

- name: Python tests
run: cmake --build . --target pytest -j 2
run: cmake --build . --target pytest -j 4

- name: C++ tests
run: cmake --build . --target cpptest -j 2
run: cmake --build . --target cpptest -j 4

- name: Interface test
run: cmake --build . --target test_cmake_build -j 2
run: cmake --build . --target test_cmake_build -j 4

- name: Clean directory
run: git clean -fdx
Expand Down Expand Up @@ -1202,16 +1206,16 @@ jobs:
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
run: cmake --build . -j 2
run: cmake --build . -j 4

- name: Python tests
run: cmake --build . --target pytest -j 2
run: cmake --build . --target pytest -j 4

- name: C++ tests
run: cmake --build . --target cpptest -j 2
run: cmake --build . --target cpptest -j 4

- name: Interface test
run: cmake --build . --target test_cmake_build -j 2
run: cmake --build . --target test_cmake_build -j 4

- name: CMake Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: >
Expand All @@ -1226,10 +1230,10 @@ jobs:
"-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"

- name: Build - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: cmake --build build_partial -j 2
run: cmake --build build_partial -j 4

- name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
run: cmake --build build_partial --target pytest -j 2
run: cmake --build build_partial --target pytest -j 4

- name: Clean directory
run: git clean -fdx
Loading