File: ci.yml

package info (click to toggle)
pybind11 3.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,448 kB
  • sloc: cpp: 27,239; python: 13,512; ansic: 4,244; makefile: 204; sh: 36
file content (1279 lines) | stat: -rw-r--r-- 39,811 bytes parent folder | download | duplicates (2)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
name: CI

on:
  workflow_dispatch:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened
      - ready_for_review

permissions: read-all

concurrency:
  group: test-${{ github.ref }}
  cancel-in-progress: true

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:
  # This is the "main" test suite, which tests a large number of different
  # versions of default compilers and Python versions in GitHub Actions.
  # 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 -DPYBIND11_TEST_SMART_HOLDER=ON
          - 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:
        include:
          - 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: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_STANDARD=17
          - runs-on: ubuntu-latest
            python-version: '3.12'
            cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -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 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRETER_SUPPORT=0"
          - 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: -DPYBIND11_TEST_SMART_HOLDER=ON
          - 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-latest
            python-version: '3.9'
            cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON
          - runs-on: windows-2022
            python-version: '3.8'
            cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DPYBIND11_NUMPY_1_ONLY=ON
          - runs-on: windows-2022
            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-version: '3.11'
          #   cmake-args: -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
          - runs-on: windows-2022
            python-version: '3.10'
            cmake-args: -DPYBIND11_TEST_SMART_HOLDER=ON -DCMAKE_CXX_FLAGS="/GR /EHsc"
          - runs-on: windows-2022
            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

    name: 🐍
    uses: ./.github/workflows/reusable-standard.yml
    with:
      runs-on: ${{ matrix.runs-on }}
      python-version: ${{ matrix.python-version }}
      cmake-args: ${{ matrix.cmake-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-version: '3.9'
          - runs-on: macos-latest
            python-version: '3.12'
          - runs-on: windows-latest
            python-version: '3.11'

    name: "🐍 ${{ matrix.python-version }} • ${{ matrix.runs-on }} • x64 inplace C++14"
    runs-on: ${{ matrix.runs-on }}

    steps:
    - uses: actions/checkout@v4

    - name: Setup Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
        allow-prereleases: true

    - 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

    # 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"

    # More-or-less randomly adding a few extra flags here
    - name: Configure
      run: >
        cmake -S. -B.
        -DPYBIND11_WERROR=ON
        -DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
        -DPYBIND11_PYTEST_ARGS=-v
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        -DCMAKE_CXX_STANDARD=14

    # 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 .

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

    - name: Compiled tests
      run: cmake --build . --target cpptest

    - name: Interface test
      run: cmake --build . --target test_cmake_build

    - name: Visibility test
      run: cmake --build . --target test_cross_module_rtti


  manylinux:
    name: Manylinux on 🐍 3.13t • GIL
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    timeout-minutes: 40
    container: quay.io/pypa/musllinux_1_2_x86_64:latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Prepare uv's path
        run: echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Install ninja
        run: uv tool install ninja

      - name: Configure via preset
        run: cmake --preset venv -DPYBIND11_CREATE_WITH_UV=python3.13t

      - name: Build C++11
        run: cmake --build --preset venv

      - name: Python tests C++11
        run: cmake --build --preset testsvenv -t pytest

  deadsnakes:
    if: github.event.pull_request.draft == false
    strategy:
      fail-fast: false
      matrix:
        include:
        # TODO: Fails on 3.10, investigate
        # JOB DISABLED (NEEDS WORK): https://github.com/pybind/pybind11/issues/4889
        # - python-version: "3.9"
        #   python-debug: true
        #   valgrind: true
        - python-version: "3.11"
          python-debug: false

    name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Setup Python ${{ matrix.python-version }} (deadsnakes)
      uses: deadsnakes/action@v3.2.0
      with:
        python-version: ${{ matrix.python-version }}
        debug: ${{ matrix.python-debug }}

    - name: Update CMake
      uses: jwlawson/actions-setup-cmake@v2.0

    - name: Valgrind cache
      if: matrix.valgrind
      uses: actions/cache@v4
      id: cache-valgrind
      with:
        path: valgrind
        key: 3.16.1 # Valgrind version

    - name: Compile Valgrind
      if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true'
      run: |
        VALGRIND_VERSION=3.16.1
        curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj
        mv valgrind-$VALGRIND_VERSION valgrind
        cd valgrind
        ./configure
        make -j 2 > /dev/null

    - name: Install Valgrind
      if: matrix.valgrind
      working-directory: valgrind
      run: |
        sudo make install
        sudo apt-get update
        sudo apt-get install ninja-build libc6-dbg

    - name: Prepare env
      run: |
        python -m pip install -r tests/requirements.txt

    - name: Configure
      run: cmake --preset default -DCMAKE_CXX_STANDARD=17

    - name: Build
      run: cmake --build --preset default

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

    - name: C++ tests
      run: cmake --build --preset default --target cpptest

    - name: Visibility test
      run: cmake --build --preset default --target test_cross_module_rtti

    - name: Run Valgrind on Python tests
      if: matrix.valgrind
      run: cmake --build --preset default --target memcheck


  # Testing on clang using the excellent silkeh clang docker images
  clang:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - clang: 5
            std: 14
          - clang: 11
            std: 20
          - clang: 14
            std: 20
          - clang: 16
            std: 20
            container_suffix: "-bullseye"
          - clang: 18
            std: 20
            cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls"
            container_suffix: "-bookworm"

    name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}"
    container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}"

    steps:
    - uses: actions/checkout@v4

    - name: Add wget and python3
      run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev

    - name: Configure
      shell: bash
      run: >
        cmake -S . -B build
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
        -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

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

    - 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: Visibility test
      run: cmake --build build --target test_cross_module_rtti

  # Testing NVCC; forces sources to behave like .cu files
  cuda:
    runs-on: ubuntu-latest
    name: "🐍 3.10 • CUDA 12.2 • Ubuntu 22.04"
    container: nvidia/cuda:12.2.0-devel-ubuntu22.04

    steps:
    - uses: actions/checkout@v4

    # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
    - name: Install 🐍 3
      run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy

    - name: Configure
      run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON

    - name: Build
      run: cmake --build build -j2 --verbose

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


# TODO: Internal compiler error - report to NVidia
#  # Testing CentOS 8 + PGI compilers
#  centos-nvhpc8:
#    runs-on: ubuntu-latest
#    name: "🐍 3 • CentOS8 / PGI 20.11 • x64"
#    container: centos:8
#
#    steps:
#    - uses: actions/checkout@v4
#
#    - name: Add Python 3 and a few requirements
#      run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules
#
#    - name: Install CMake with pip
#      run: |
#        python3 -m pip install --upgrade pip
#        python3 -m pip install cmake --prefer-binary
#
#    - name: Install NVidia HPC SDK
#      run: >
#        yum -y install
#        https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm
#        https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm
#
#    - name: Configure
#      shell: bash
#      run: |
#        source /etc/profile.d/modules.sh
#        module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11
#        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
#
#    - 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


  # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds
  ubuntu-nvhpc7:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-22.04
    name: "🐍 3 • NVHPC 23.5 • C++17 • x64"

    env:
      # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
      DEBIAN_FRONTEND: 'noninteractive'
    steps:
    - uses: actions/checkout@v4

    - name: Add NVHPC Repo
      run: |
        echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | \
          sudo tee /etc/apt/sources.list.d/nvhpc.list

    - name: Install 🐍 3 & NVHPC
      run: |
        sudo apt-get update -y && \
        sudo apt-get install -y cmake environment-modules git python3-dev python3-pip python3-numpy && \
        sudo apt-get install -y --no-install-recommends nvhpc-23-5 && \
        sudo rm -rf /var/lib/apt/lists/*
        python3 -m pip install --upgrade pip
        python3 -m pip install --upgrade pytest

    # On some systems, you many need further workarounds:
    # https://github.com/pybind/pybind11/pull/2475
    - name: Configure
      shell: bash
      run: |
        source /etc/profile.d/modules.sh
        module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/23.5
        cmake -S . -B build -DDOWNLOAD_CATCH=ON \
                            -DCMAKE_CXX_STANDARD=17 \
                            -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
                            -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \
                            -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp"

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

    - 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: Visibility test
      run: cmake --build build --target test_cross_module_rtti

  # Testing on GCC using the GCC docker images (only recent images supported)
  gcc:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - { gcc: 9, std: 20 }
          - { gcc: 10, std: 17 }
          - { gcc: 10, std: 20 }
          - { gcc: 13, std: 20, cxx_flags: "-Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" }

    name: "🐍 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}"
    container: "gcc:${{ matrix.gcc }}"

    steps:
    - uses: actions/checkout@v4

    - name: Add Python 3
      run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev

    - name: Update pip
      run: python3 -m pip install --upgrade pip

    - name: Update CMake
      uses: jwlawson/actions-setup-cmake@v2.0

    - name: Configure
      shell: bash
      run: >
        cmake -S . -B build
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
        -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

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

    - 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: Visibility test
      run: cmake --build build --target test_cross_module_rtti

    - name: Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE
      if: matrix.gcc == '12'
      shell: bash
      run: >
        cmake -S . -B build_partial
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
        "-DPYBIND11_TEST_OVERRIDE=test_call_policies.cpp;test_gil_scoped.cpp;test_thread.cpp"

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

    - name: Python tests - Exercise cmake -DPYBIND11_TEST_OVERRIDE
      if: matrix.gcc == '12'
      run: cmake --build build_partial --target pytest

  # Testing on ICC using the oneAPI apt repo
  icc:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-22.04

    name: "🐍 3 • ICC latest • x64"

    steps:
    - uses: actions/checkout@v4

    - name: Add apt repo
      run: |
        sudo apt-get update
        sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
        wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
        sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
        echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list

    - name: Add ICC & Python 3
      run: sudo apt-get update; sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic cmake python3-dev python3-numpy python3-pytest python3-pip

    - name: Update pip
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        python3 -m pip install --upgrade pip

    - name: Install dependencies
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        python3 -m pip install -r tests/requirements.txt

    - name: Configure C++11
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake -S . -B build-11     \
        -DPYBIND11_WERROR=ON    \
        -DDOWNLOAD_CATCH=ON     \
        -DDOWNLOAD_EIGEN=OFF    \
        -DCMAKE_CXX_STANDARD=11             \
        -DCMAKE_CXX_COMPILER=$(which icpc)  \
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

    - name: Build C++11
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-11 -j 2 -v

    - name: Python tests C++11
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        sudo service apport stop
        cmake --build build-11 --target check

    - name: C++ tests C++11
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-11 --target cpptest

    - name: Interface test C++11
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-11 --target test_cmake_build

    - name: Visibility test
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-11 --target test_cross_module_rtti

    - name: Configure C++17
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake -S . -B build-17     \
        -DPYBIND11_WERROR=ON    \
        -DDOWNLOAD_CATCH=ON     \
        -DDOWNLOAD_EIGEN=OFF    \
        -DCMAKE_CXX_STANDARD=17             \
        -DCMAKE_CXX_COMPILER=$(which icpc)  \
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

    - name: Build C++17
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-17 -j 2 -v

    - name: Python tests C++17
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        sudo service apport stop
        cmake --build build-17 --target check

    - name: C++ tests C++17
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-17 --target cpptest

    - name: Interface test C++17
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-17 --target test_cmake_build

    - name: Visibility test
      run: |
        set +e; source /opt/intel/oneapi/setvars.sh; set -e
        cmake --build build-17 --target test_cross_module_rtti

  # Testing on CentOS (manylinux uses a centos base).
  centos:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        container:
          - "almalinux:8"
          - "almalinux:9"

    name: "🐍 3 • ${{ matrix.container }} • x64"
    container: "${{ matrix.container }}"

    steps:
    - name: Latest actions/checkout
      uses: actions/checkout@v4

    - name: Add Python 3.8
      if: matrix.container == 'almalinux:8'
      run: dnf update -y && dnf install -y python38-devel gcc-c++ make git

    - name: Add Python 3 (default)
      if: matrix.container != 'almalinux:8'
      run: dnf update -y && dnf install -y python3-devel gcc-c++ make git

    - name: Update pip
      run: python3 -m pip install --upgrade pip

    - name: Install dependencies
      run: |
        python3 -m pip install cmake -r tests/requirements.txt

    - name: Ensure NumPy 2 is used (required Python >= 3.9)
      if: matrix.container == 'almalinux:9'
      run: |
        python3 -m pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1'

    - name: Configure
      shell: bash
      run: >
        cmake -S . -B build
        -DCMAKE_BUILD_TYPE=MinSizeRel
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        -DCMAKE_CXX_STANDARD=11
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

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

    - 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: Visibility test
      run: cmake --build build --target test_cross_module_rtti


  # This tests an "install" with the CMake tools
  install-classic:
    if: github.event.pull_request.draft == false
    name: "🐍 3.9 • Debian • x86 •  Install"
    runs-on: ubuntu-latest
    container: i386/debian:bullseye

    steps:
    - uses: actions/checkout@v1  # v1 is required to run inside docker

    - name: Install requirements
      run: |
        apt-get update
        apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip
        pip3 install "pytest==6.*"

    - name: Configure for install
      run: >
        cmake .
        -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

    - name: Make and install
      run: make install

    - name: Copy tests to new directory
      run: cp -a tests /pybind11-tests

    - name: Make a new test directory
      run: mkdir /build-tests

    - name: Configure tests
      run: >
        cmake ../pybind11-tests
        -DDOWNLOAD_CATCH=ON
        -DPYBIND11_WERROR=ON
        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
      working-directory: /build-tests

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


  # This verifies that the documentation is not horribly broken, and does a
  # basic validation check on the SDist.
  doxygen:
    if: github.event.pull_request.draft == false
    name: "Documentation build test"
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-python@v5
      with:
        python-version: "3.x"

    - name: Install Doxygen
      run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04

    - name: Build docs
      run: pipx run nox -s docs

    - name: Make SDist
      run: pipx run nox -s build -- --sdist

    - run: git status --ignored

    - name: Check local include dir
      run: >
        ls pybind11;
        python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'"

    - name: Compare Dists (headers only)
      working-directory: include
      run: |
        python3 -m pip install --user -U ../dist/*.tar.gz
        installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')")
        diff -rq $installed ./pybind11

  win32:
    if: github.event.pull_request.draft == false
    strategy:
      fail-fast: false
      matrix:
        include:
          - python: '3.8'
            args: -DCMAKE_CXX_STANDARD=17
          - python: '3.10'
            args: -DCMAKE_CXX_STANDARD=20
          - python: '3.13'


    name: "🐍 ${{ matrix.python }} • MSVC 2022 • x86 ${{ matrix.args }}"
    runs-on: windows-2022

    steps:
    - uses: actions/checkout@v4

    - name: Setup Python ${{ matrix.python }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python }}
        architecture: x86
        # Python 3.13.4 broken on Windows
        check-latest: >-
          ${{ matrix.python == '3.13' && runner.os == 'Windows' }}

    - name: Update CMake
      uses: jwlawson/actions-setup-cmake@v2.0

    - name: Prepare MSVC
      uses: ilammy/msvc-dev-cmd@v1.13.0
      with:
        arch: x86

    - name: Prepare env
      run: |
        python -m pip install -r tests/requirements.txt

    - name: Configure ${{ matrix.args }}
      run: >
        cmake -S . -B build
        -G "Visual Studio 17 2022" -A Win32
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        ${{ matrix.args }}
    - name: Build C++11
      run: cmake --build build -j 2

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

  win32-debug:
    if: github.event.pull_request.draft == false
    strategy:
      fail-fast: false
      matrix:
        include:
          - python: 3.9
            args: -DCMAKE_CXX_STANDARD=20
          - python: 3.8
            args: -DCMAKE_CXX_STANDARD=17

    name: "🐍 ${{ matrix.python }} • MSVC 2022 (Debug) • x86 ${{ matrix.args }}"
    runs-on: windows-2022

    steps:
    - uses: actions/checkout@v4

    - name: Setup Python ${{ matrix.python }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python }}
        architecture: x86

    - name: Update CMake
      uses: jwlawson/actions-setup-cmake@v2.0

    - name: Prepare MSVC
      uses: ilammy/msvc-dev-cmd@v1.13.0
      with:
        arch: x86

    - name: Prepare env
      run: |
        python -m pip install -r tests/requirements.txt

    - name: Configure ${{ matrix.args }}
      run: >
        cmake -S . -B build
        -G "Visual Studio 17 2022" -A Win32
        -DCMAKE_BUILD_TYPE=Debug
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        ${{ matrix.args }}
    - name: Build C++11
      run: cmake --build build --config Debug -j 2

    - name: Python tests
      run: cmake --build build --config Debug -t pytest


  windows-2022:
    if: github.event.pull_request.draft == false
    strategy:
      fail-fast: false
      matrix:
        python:
        - 3.9

    name: "🐍 ${{ matrix.python }} • MSVC 2022 C++20 • x64"
    runs-on: windows-2022

    steps:
    - uses: actions/checkout@v4

    - name: Setup Python ${{ matrix.python }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python }}

    - name: Prepare env
      run: python3 -m pip install -r tests/requirements.txt

    - name: Update CMake
      uses: jwlawson/actions-setup-cmake@v2.0

    - name: Configure C++20
      run: >
        cmake -S . -B build
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        -DCMAKE_CXX_STANDARD=20

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

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

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

    - name: Interface test C++20
      run: cmake --build build --target test_cmake_build

    - name: Visibility test
      run: cmake --build build --target test_cross_module_rtti

    - name: Configure C++20 - Exercise cmake -DPYBIND11_TEST_OVERRIDE
      run: >
        cmake -S . -B build_partial
        -DPYBIND11_WERROR=ON
        -DDOWNLOAD_CATCH=ON
        -DDOWNLOAD_EIGEN=ON
        -DCMAKE_CXX_STANDARD=20
        "-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

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

  mingw:
    if: github.event.pull_request.draft == false
    name: "🐍 3 • windows-latest • ${{ matrix.sys }}"
    runs-on: windows-latest
    defaults:
      run:
        shell: msys2 {0}
    strategy:
      fail-fast: false
      matrix:
        include:
          - { sys: mingw64, env: x86_64 }
          - { sys: mingw32, env: i686 }
    steps:
    - uses: msys2/setup-msys2@v2
      with:
        msystem: ${{matrix.sys}}
        install: >-
          git
          mingw-w64-${{matrix.env}}-gcc
          mingw-w64-${{matrix.env}}-python-pip
          mingw-w64-${{matrix.env}}-cmake
          mingw-w64-${{matrix.env}}-make
          mingw-w64-${{matrix.env}}-python-pytest
          mingw-w64-${{matrix.env}}-boost
          mingw-w64-${{matrix.env}}-catch

    - uses: msys2/setup-msys2@v2
      if: matrix.sys == 'mingw64'
      with:
        msystem: ${{matrix.sys}}
        install: >-
          mingw-w64-${{matrix.env}}-python-numpy
          mingw-w64-${{matrix.env}}-python-scipy
          mingw-w64-${{matrix.env}}-eigen3

    - uses: actions/checkout@v4

    - name: Configure C++11
      # LTO leads to many undefined reference like
      # `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&)
      run: >-
        cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
        -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
        -S . -B build

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

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

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

    - name: Interface test C++11
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cmake_build

    - name: Visibility test
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build --target test_cross_module_rtti

    - name: Clean directory
      run: git clean -fdx

    - name: Configure C++14
      run: >-
        cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
        -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
        -S . -B build2

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

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

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

    - name: Interface test C++14
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cmake_build

    - name: Visibility test
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build2 --target test_cross_module_rtti

    - name: Clean directory
      run: git clean -fdx

    - name: Configure C++17
      run: >-
        cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
        -DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
        -S . -B build3

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

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

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

    - name: Interface test C++17
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cmake_build

    - name: Visibility test
      run: PYTHONHOME=/${{matrix.sys}} PYTHONPATH=/${{matrix.sys}} cmake --build build3 --target test_cross_module_rtti

  windows_clang:
    if: github.event.pull_request.draft == false

    strategy:
      matrix:
        os: [windows-latest]
        python: ['3.10']

    runs-on: "${{ matrix.os }}"

    name: "🐍 ${{ matrix.python }} • ${{ matrix.os }} • clang-latest"

    steps:
      - name: Show env
        run: env

      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Clang
        uses: egor-tensin/setup-clang@v1

      - name: Setup Python ${{ matrix.python }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}

      - name: Update CMake
        uses: jwlawson/actions-setup-cmake@v2.0

      - name: Install ninja-build tool
        uses: seanmiddleditch/gha-setup-ninja@v6

      - name: Run pip installs
        run: |
          python -m pip install --upgrade pip
          python -m pip install -r tests/requirements.txt

      - name: Show Clang++ version
        run: clang++ --version

      - name: Show CMake version
        run: cmake --version

      # TODO: WERROR=ON
      - name: Configure Clang
        run: >
          cmake -G Ninja -S . -B .
          -DPYBIND11_WERROR=OFF
          -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
          -DDOWNLOAD_CATCH=ON
          -DDOWNLOAD_EIGEN=ON
          -DCMAKE_CXX_COMPILER=clang++
          -DCMAKE_CXX_STANDARD=17

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

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

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

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

      - name: Visibility test
        run: cmake --build . --target test_cross_module_rtti -j 2

      - name: Clean directory
        run: git clean -fdx

  macos_brew_install_llvm:
    if: github.event.pull_request.draft == false
    name: "macos-13 • brew install llvm"
    runs-on: macos-13

    env:
      # https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
      LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'

    steps:
      - name: Update PATH
        run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH

      - name: Show env
        run: env

      - name: Checkout
        uses: actions/checkout@v4

      - name: Show Clang++ version before brew install llvm
        run: clang++ --version

      - name: brew install llvm
        run: brew install llvm

      - name: Show Clang++ version after brew install llvm
        run: clang++ --version

      - name: Update CMake
        uses: jwlawson/actions-setup-cmake@v2.0

      - name: Run pip installs
        run: |
          python3 -m pip install --upgrade pip
          python3 -m pip install -r tests/requirements.txt
          python3 -m pip install numpy
          python3 -m pip install scipy

      - name: Show CMake version
        run: cmake --version

      - name: CMake Configure
        run: >
          cmake -S . -B .
          -DPYBIND11_WERROR=ON
          -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
          -DDOWNLOAD_CATCH=ON
          -DDOWNLOAD_EIGEN=ON
          -DCMAKE_CXX_COMPILER=clang++
          -DCMAKE_CXX_STANDARD=17
          -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

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

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

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

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

      - name: Visibility test
        run: cmake --build . --target test_cross_module_rtti -j 2

      - name: CMake Configure - Exercise cmake -DPYBIND11_TEST_OVERRIDE
        run: >
          cmake -S . -B build_partial
          -DPYBIND11_WERROR=ON
          -DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
          -DDOWNLOAD_CATCH=ON
          -DDOWNLOAD_EIGEN=ON
          -DCMAKE_CXX_COMPILER=clang++
          -DCMAKE_CXX_STANDARD=17
          -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
          "-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

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

      - name: Clean directory
        run: git clean -fdx