• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  workflow_dispatch:
5  pull_request:
6  push:
7    branches:
8      - master
9      - stable
10      - v*
11
12jobs:
13  # This is the "main" test suite, which tests a large number of different
14  # versions of default compilers and Python versions in GitHub Actions.
15  standard:
16    strategy:
17      fail-fast: false
18      matrix:
19        runs-on: [ubuntu-latest, windows-latest, macos-latest]
20        python:
21        - 2.7
22        - 3.5
23        - 3.6
24        - 3.9
25        # - 3.10-dev  # Re-enable once 3.10.0a5 is released
26        - pypy2
27        - pypy3
28
29        # Items in here will either be added to the build matrix (if not
30        # present), or add new keys to an existing matrix element if all the
31        # existing keys match.
32        #
33        # We support three optional keys: args (both build), args1 (first
34        # build), and args2 (second build).
35        include:
36          # Just add a key
37          - runs-on: ubuntu-latest
38            python: 3.6
39            args: >
40              -DPYBIND11_FINDPYTHON=ON
41          - runs-on: windows-latest
42            python: 3.6
43            args: >
44              -DPYBIND11_FINDPYTHON=ON
45
46        # These items will be removed from the build matrix, keys must match.
47        exclude:
48            # Currently 32bit only, and we build 64bit
49          - runs-on: windows-latest
50            python: pypy2
51          - runs-on: windows-latest
52            python: pypy3
53
54          # TODO: PyPy2 7.3.3 segfaults, while 7.3.2 was fine.
55          - runs-on: ubuntu-latest
56            python: pypy2
57
58    name: "�� ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
59    runs-on: ${{ matrix.runs-on }}
60
61    steps:
62    - uses: actions/checkout@v2
63
64    - name: Setup Python ${{ matrix.python }}
65      uses: actions/setup-python@v2
66      with:
67        python-version: ${{ matrix.python }}
68
69    - name: Setup Boost (Windows / Linux latest)
70      shell: bash
71      run: echo "BOOST_ROOT=$BOOST_ROOT_1_72_0" >> $GITHUB_ENV
72
73    - name: Update CMake
74      uses: jwlawson/actions-setup-cmake@v1.7
75
76    - name: Cache wheels
77      if: runner.os == 'macOS'
78      uses: actions/cache@v2
79      with:
80        # This path is specific to macOS - we really only need it for PyPy NumPy wheels
81        # See https://github.com/actions/cache/blob/master/examples.md#python---pip
82        # for ways to do this more generally
83        path: ~/Library/Caches/pip
84        # Look to see if there is a cache hit for the corresponding requirements file
85        key: ${{ runner.os }}-pip-${{ matrix.python }}-x64-${{ hashFiles('tests/requirements.txt') }}
86
87    - name: Prepare env
88      run: python -m pip install -r tests/requirements.txt --prefer-binary
89
90    - name: Setup annotations on Linux
91      if: runner.os == 'Linux'
92      run: python -m pip install pytest-github-actions-annotate-failures
93
94    # First build - C++11 mode and inplace
95    - name: Configure C++11 ${{ matrix.args }}
96      run: >
97        cmake -S . -B .
98        -DPYBIND11_WERROR=ON
99        -DDOWNLOAD_CATCH=ON
100        -DDOWNLOAD_EIGEN=ON
101        -DCMAKE_CXX_STANDARD=11
102        ${{ matrix.args }}
103
104    - name: Build C++11
105      run: cmake --build . -j 2
106
107    - name: Python tests C++11
108      run: cmake --build . --target pytest -j 2
109
110    - name: C++11 tests
111      # TODO: Figure out how to load the DLL on Python 3.8+
112      if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10-dev'))"
113      run: cmake --build .  --target cpptest -j 2
114
115    - name: Interface test C++11
116      run: cmake --build . --target test_cmake_build
117
118    - name: Clean directory
119      run: git clean -fdx
120
121    # Second build - C++17 mode and in a build directory
122    - name: Configure ${{ matrix.args2 }}
123      run: >
124        cmake -S . -B build2
125        -DPYBIND11_WERROR=ON
126        -DDOWNLOAD_CATCH=ON
127        -DDOWNLOAD_EIGEN=ON
128        -DCMAKE_CXX_STANDARD=17
129        ${{ matrix.args }}
130        ${{ matrix.args2 }}
131
132    - name: Build
133      run: cmake --build build2 -j 2
134
135    - name: Python tests
136      run: cmake --build build2 --target pytest
137
138    - name: C++ tests
139      # TODO: Figure out how to load the DLL on Python 3.8+
140      if: "!(runner.os == 'Windows' && (matrix.python == 3.8 || matrix.python == 3.9 || matrix.python == '3.10-dev'))"
141      run: cmake --build build2 --target cpptest
142
143    - name: Interface test
144      run: cmake --build build2 --target test_cmake_build
145
146    # Eventually Microsoft might have an action for setting up
147    # MSVC, but for now, this action works:
148    - name: Prepare compiler environment for Windows �� 2.7
149      if: matrix.python == 2.7 && runner.os == 'Windows'
150      uses: ilammy/msvc-dev-cmd@v1
151      with:
152        arch: x64
153
154    # This makes two environment variables available in the following step(s)
155    - name: Set Windows �� 2.7 environment variables
156      if: matrix.python == 2.7 && runner.os == 'Windows'
157      shell: bash
158      run: |
159        echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
160        echo "MSSdk=1" >> $GITHUB_ENV
161
162    # This makes sure the setup_helpers module can build packages using
163    # setuptools
164    - name: Setuptools helpers test
165      run: pytest tests/extra_setuptools
166
167
168  deadsnakes:
169    strategy:
170      fail-fast: false
171      matrix:
172        include:
173        - python-version: 3.9
174          python-debug: true
175          valgrind: true
176        - python-version: 3.10-dev
177          python-debug: false
178
179    name: "�� ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
180    runs-on: ubuntu-latest
181
182    steps:
183    - uses: actions/checkout@v2
184
185    - name: Setup Python ${{ matrix.python-version }} (deadsnakes)
186      uses: deadsnakes/action@v2.1.1
187      with:
188        python-version: ${{ matrix.python-version }}
189        debug: ${{ matrix.python-debug }}
190
191    - name: Update CMake
192      uses: jwlawson/actions-setup-cmake@v1.7
193
194    - name: Valgrind cache
195      if: matrix.valgrind
196      uses: actions/cache@v2
197      id: cache-valgrind
198      with:
199        path: valgrind
200        key: 3.16.1 # Valgrind version
201
202    - name: Compile Valgrind
203      if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true'
204      run: |
205        VALGRIND_VERSION=3.16.1
206        curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj
207        mv valgrind-$VALGRIND_VERSION valgrind
208        cd valgrind
209        ./configure
210        make -j 2 > /dev/null
211
212    - name: Install Valgrind
213      if: matrix.valgrind
214      working-directory: valgrind
215      run: |
216        sudo make install
217        sudo apt-get update
218        sudo apt-get install libc6-dbg  # Needed by Valgrind
219
220    - name: Prepare env
221      run: python -m pip install -r tests/requirements.txt --prefer-binary
222
223    - name: Configure
224      run: >
225        cmake -S . -B build
226        -DCMAKE_BUILD_TYPE=Debug
227        -DPYBIND11_WERROR=ON
228        -DDOWNLOAD_CATCH=ON
229        -DDOWNLOAD_EIGEN=ON
230        -DCMAKE_CXX_STANDARD=17
231
232    - name: Build
233      run: cmake --build build -j 2
234
235    - name: Python tests
236      run: cmake --build build --target pytest
237
238    - name: C++ tests
239      run: cmake --build build --target cpptest
240
241    - name: Run Valgrind on Python tests
242      if: matrix.valgrind
243      run: cmake --build build --target memcheck
244
245
246  # Testing on clang using the excellent silkeh clang docker images
247  clang:
248    runs-on: ubuntu-latest
249    strategy:
250      fail-fast: false
251      matrix:
252        clang:
253          - 3.6
254          - 3.7
255          - 3.9
256          - 7
257          - 9
258          - dev
259        std:
260          - 11
261        include:
262          - clang: 5
263            std: 14
264          - clang: 10
265            std: 20
266          - clang: 10
267            std: 17
268
269    name: "�� 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64"
270    container: "silkeh/clang:${{ matrix.clang }}"
271
272    steps:
273    - uses: actions/checkout@v2
274
275    - name: Add wget and python3
276      run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
277
278    - name: Configure
279      shell: bash
280      run: >
281        cmake -S . -B build
282        -DPYBIND11_WERROR=ON
283        -DDOWNLOAD_CATCH=ON
284        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
285        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
286
287    - name: Build
288      run: cmake --build build -j 2
289
290    - name: Python tests
291      run: cmake --build build --target pytest
292
293    - name: C++ tests
294      run: cmake --build build --target cpptest
295
296    - name: Interface test
297      run: cmake --build build --target test_cmake_build
298
299
300  # Testing NVCC; forces sources to behave like .cu files
301  cuda:
302    runs-on: ubuntu-latest
303    name: "�� 3.8 • CUDA 11 • Ubuntu 20.04"
304    container: nvidia/cuda:11.0-devel-ubuntu20.04
305
306    steps:
307    - uses: actions/checkout@v2
308
309    # tzdata will try to ask for the timezone, so set the DEBIAN_FRONTEND
310    - name: Install �� 3
311      run: apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake git python3-dev python3-pytest python3-numpy
312
313    - name: Configure
314      run: cmake -S . -B build -DPYBIND11_CUDA_TESTS=ON -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON
315
316    - name: Build
317      run: cmake --build build -j2 --verbose
318
319    - name: Python tests
320      run: cmake --build build --target pytest
321
322
323# TODO: Internal compiler error - report to NVidia
324#  # Testing CentOS 8 + PGI compilers
325#  centos-nvhpc8:
326#    runs-on: ubuntu-latest
327#    name: "�� 3 • CentOS8 / PGI 20.11 • x64"
328#    container: centos:8
329#
330#    steps:
331#    - uses: actions/checkout@v2
332#
333#    - name: Add Python 3 and a few requirements
334#      run: yum update -y && yum install -y git python3-devel python3-numpy python3-pytest make environment-modules
335#
336#    - name: Install CMake with pip
337#      run: |
338#        python3 -m pip install --upgrade pip
339#        python3 -m pip install cmake --prefer-binary
340#
341#    - name: Install NVidia HPC SDK
342#      run: >
343#        yum -y install
344#        https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-20-11-20.11-1.x86_64.rpm
345#        https://developer.download.nvidia.com/hpc-sdk/20.11/nvhpc-2020-20.11-1.x86_64.rpm
346#
347#    - name: Configure
348#      shell: bash
349#      run: |
350#        source /etc/profile.d/modules.sh
351#        module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.11
352#        cmake -S . -B build -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=14 -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
353#
354#    - name: Build
355#      run: cmake --build build -j 2 --verbose
356#
357#    - name: Python tests
358#      run: cmake --build build --target pytest
359#
360#    - name: C++ tests
361#      run: cmake --build build --target cpptest
362#
363#    - name: Interface test
364#      run: cmake --build build --target test_cmake_build
365
366
367  # Testing on CentOS 7 + PGI compilers, which seems to require more workarounds
368  centos-nvhpc7:
369    runs-on: ubuntu-latest
370    name: "�� 3 • CentOS7 / PGI 20.9 • x64"
371    container: centos:7
372
373    steps:
374    - uses: actions/checkout@v2
375
376    - name: Add Python 3 and a few requirements
377      run: yum update -y && yum install -y epel-release && yum install -y git python3-devel make environment-modules cmake3
378
379    - name: Install NVidia HPC SDK
380      run:  yum -y install https://developer.download.nvidia.com/hpc-sdk/20.9/nvhpc-20-9-20.9-1.x86_64.rpm https://developer.download.nvidia.com/hpc-sdk/20.9/nvhpc-2020-20.9-1.x86_64.rpm
381
382    # On CentOS 7, we have to filter a few tests (compiler internal error)
383    # and allow deeper templete recursion (not needed on CentOS 8 with a newer
384    # standard library). On some systems, you many need further workarounds:
385    # https://github.com/pybind/pybind11/pull/2475
386    - name: Configure
387      shell: bash
388      run: |
389        source /etc/profile.d/modules.sh
390        module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/20.9
391        cmake3 -S . -B build -DDOWNLOAD_CATCH=ON \
392                            -DCMAKE_CXX_STANDARD=11 \
393                            -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
394                            -DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \
395                            -DPYBIND11_TEST_FILTER="test_smart_ptr.cpp;test_virtual_functions.cpp"
396
397    # Building before installing Pip should produce a warning but not an error
398    - name: Build
399      run: cmake3 --build build -j 2 --verbose
400
401    - name: Install CMake with pip
402      run: |
403        python3 -m pip install --upgrade pip
404        python3 -m pip install pytest
405
406    - name: Python tests
407      run: cmake3 --build build --target pytest
408
409    - name: C++ tests
410      run: cmake3 --build build --target cpptest
411
412    - name: Interface test
413      run: cmake3 --build build --target test_cmake_build
414
415
416  # Testing on GCC using the GCC docker images (only recent images supported)
417  gcc:
418    runs-on: ubuntu-latest
419    strategy:
420      fail-fast: false
421      matrix:
422        gcc:
423          - 7
424          - latest
425        std:
426          - 11
427        include:
428          - gcc: 10
429            std: 20
430
431    name: "�� 3 • GCC ${{ matrix.gcc }} • C++${{ matrix.std }}• x64"
432    container: "gcc:${{ matrix.gcc }}"
433
434    steps:
435    - uses: actions/checkout@v1
436
437    - name: Add Python 3
438      run: apt-get update; apt-get install -y python3-dev python3-numpy python3-pytest python3-pip libeigen3-dev
439
440    - name: Update pip
441      run: python3 -m pip install --upgrade pip
442
443    - name: Update CMake
444      uses: jwlawson/actions-setup-cmake@v1.7
445
446    - name: Configure
447      shell: bash
448      run: >
449        cmake -S . -B build
450        -DPYBIND11_WERROR=ON
451        -DDOWNLOAD_CATCH=ON
452        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
453        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
454
455    - name: Build
456      run: cmake --build build -j 2
457
458    - name: Python tests
459      run: cmake --build build --target pytest
460
461    - name: C++ tests
462      run: cmake --build build --target cpptest
463
464    - name: Interface test
465      run: cmake --build build --target test_cmake_build
466
467
468  # Testing on ICC using the oneAPI apt repo
469  icc:
470    runs-on: ubuntu-20.04
471    strategy:
472      fail-fast: false
473
474    name: "�� 3 • ICC latest • x64"
475
476    steps:
477    - uses: actions/checkout@v2
478
479    - name: Add apt repo
480      run: |
481        sudo apt-get update
482        sudo apt-get install -y wget build-essential pkg-config cmake ca-certificates gnupg
483        wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
484        sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
485        echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
486
487    - name: Add ICC & Python 3
488      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
489
490    - name: Update pip
491      run: |
492        set +e; source /opt/intel/oneapi/setvars.sh; set -e
493        python3 -m pip install --upgrade pip
494
495    - name: Install dependencies
496      run: |
497        set +e; source /opt/intel/oneapi/setvars.sh; set -e
498        python3 -m pip install -r tests/requirements.txt --prefer-binary
499
500    - name: Configure C++11
501      run: |
502        set +e; source /opt/intel/oneapi/setvars.sh; set -e
503        cmake -S . -B build-11     \
504        -DPYBIND11_WERROR=ON    \
505        -DDOWNLOAD_CATCH=ON     \
506        -DDOWNLOAD_EIGEN=OFF    \
507        -DCMAKE_CXX_STANDARD=11             \
508        -DCMAKE_CXX_COMPILER=$(which icpc)  \
509        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
510
511    - name: Build C++11
512      run: |
513        set +e; source /opt/intel/oneapi/setvars.sh; set -e
514        cmake --build build-11 -j 2 -v
515
516    - name: Python tests C++11
517      run: |
518        set +e; source /opt/intel/oneapi/setvars.sh; set -e
519        sudo service apport stop
520        cmake --build build-11 --target check
521
522    - name: C++ tests C++11
523      run: |
524        set +e; source /opt/intel/oneapi/setvars.sh; set -e
525        cmake --build build-11 --target cpptest
526
527    - name: Interface test C++11
528      run: |
529        set +e; source /opt/intel/oneapi/setvars.sh; set -e
530        cmake --build build-11 --target test_cmake_build
531
532    - name: Configure C++17
533      run: |
534        set +e; source /opt/intel/oneapi/setvars.sh; set -e
535        cmake -S . -B build-17     \
536        -DPYBIND11_WERROR=ON    \
537        -DDOWNLOAD_CATCH=ON     \
538        -DDOWNLOAD_EIGEN=OFF    \
539        -DCMAKE_CXX_STANDARD=17             \
540        -DCMAKE_CXX_COMPILER=$(which icpc)  \
541        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
542
543    - name: Build C++17
544      run: |
545        set +e; source /opt/intel/oneapi/setvars.sh; set -e
546        cmake --build build-17 -j 2 -v
547
548    - name: Python tests C++17
549      run: |
550        set +e; source /opt/intel/oneapi/setvars.sh; set -e
551        sudo service apport stop
552        cmake --build build-17 --target check
553
554    - name: C++ tests C++17
555      run: |
556        set +e; source /opt/intel/oneapi/setvars.sh; set -e
557        cmake --build build-17 --target cpptest
558
559    - name: Interface test C++17
560      run: |
561        set +e; source /opt/intel/oneapi/setvars.sh; set -e
562        cmake --build build-17 --target test_cmake_build
563
564
565  # Testing on CentOS (manylinux uses a centos base, and this is an easy way
566  # to get GCC 4.8, which is the manylinux1 compiler).
567  centos:
568    runs-on: ubuntu-latest
569    strategy:
570      fail-fast: false
571      matrix:
572        centos:
573          - 7  # GCC 4.8
574          - 8
575
576    name: "�� 3 • CentOS ${{ matrix.centos }} • x64"
577    container: "centos:${{ matrix.centos }}"
578
579    steps:
580    - uses: actions/checkout@v2
581
582    - name: Add Python 3
583      run: yum update -y && yum install -y python3-devel gcc-c++ make git
584
585    - name: Update pip
586      run: python3 -m pip install --upgrade pip
587
588    - name: Install dependencies
589      run: python3 -m pip install cmake -r tests/requirements.txt --prefer-binary
590
591    - name: Configure
592      shell: bash
593      run: >
594        cmake -S . -B build
595        -DPYBIND11_WERROR=ON
596        -DDOWNLOAD_CATCH=ON
597        -DDOWNLOAD_EIGEN=ON
598        -DCMAKE_CXX_STANDARD=11
599        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
600
601    - name: Build
602      run: cmake --build build -j 2
603
604    - name: Python tests
605      run: cmake --build build --target pytest
606
607    - name: C++ tests
608      run: cmake --build build --target cpptest
609
610    - name: Interface test
611      run: cmake --build build --target test_cmake_build
612
613
614  # This tests an "install" with the CMake tools
615  install-classic:
616    name: "�� 3.5 • Debian • x86 •  Install"
617    runs-on: ubuntu-latest
618    container: i386/debian:stretch
619
620    steps:
621    - uses: actions/checkout@v1
622
623    - name: Install requirements
624      run: |
625        apt-get update
626        apt-get install -y git make cmake g++ libeigen3-dev python3-dev python3-pip
627        pip3 install "pytest==3.1.*"
628
629    - name: Configure for install
630      run: >
631        cmake .
632        -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0
633        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
634
635    - name: Make and install
636      run: make install
637
638    - name: Copy tests to new directory
639      run: cp -a tests /pybind11-tests
640
641    - name: Make a new test directory
642      run: mkdir /build-tests
643
644    - name: Configure tests
645      run: >
646        cmake ../pybind11-tests
647        -DDOWNLOAD_CATCH=ON
648        -DPYBIND11_WERROR=ON
649        -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
650      working-directory: /build-tests
651
652    - name: Run tests
653      run: make pytest -j 2
654      working-directory: /build-tests
655
656
657  # This verifies that the documentation is not horribly broken, and does a
658  # basic sanity check on the SDist.
659  doxygen:
660    name: "Documentation build test"
661    runs-on: ubuntu-latest
662
663    steps:
664    - uses: actions/checkout@v2
665
666    - uses: actions/setup-python@v2
667
668    - name: Install Doxygen
669      run: sudo apt-get install -y doxygen librsvg2-bin # Changed to rsvg-convert in 20.04
670
671    - name: Install docs & setup requirements
672      run: python3 -m pip install -r docs/requirements.txt
673
674    - name: Build docs
675      run: python3 -m sphinx -W -b html docs docs/.build
676
677    - name: Make SDist
678      run: python3 setup.py sdist
679
680    - run: git status --ignored
681
682    - name: Check local include dir
683      run: >
684        ls pybind11;
685        python3 -c "import pybind11, pathlib; assert (a := pybind11.get_include()) == (b := str(pathlib.Path('include').resolve())), f'{a} != {b}'"
686
687    - name: Compare Dists (headers only)
688      working-directory: include
689      run: |
690        python3 -m pip install --user -U ../dist/*
691        installed=$(python3 -c "import pybind11; print(pybind11.get_include() + '/pybind11')")
692        diff -rq $installed ./pybind11
693
694  win32:
695    strategy:
696      fail-fast: false
697      matrix:
698        python:
699        - 3.5
700        - 3.6
701        - 3.7
702        - 3.8
703        - 3.9
704        - pypy3
705        # TODO: fix hang on pypy2
706
707        include:
708          - python: 3.9
709            args: -DCMAKE_CXX_STANDARD=20 -DDOWNLOAD_EIGEN=OFF
710          - python: 3.8
711            args: -DCMAKE_CXX_STANDARD=17
712
713    name: "�� ${{ matrix.python }} • MSVC 2019 • x86 ${{ matrix.args }}"
714    runs-on: windows-latest
715
716    steps:
717    - uses: actions/checkout@v2
718
719    - name: Setup Python ${{ matrix.python }}
720      uses: actions/setup-python@v2
721      with:
722        python-version: ${{ matrix.python }}
723        architecture: x86
724
725    - name: Update CMake
726      uses: jwlawson/actions-setup-cmake@v1.7
727
728    - name: Prepare MSVC
729      uses: ilammy/msvc-dev-cmd@v1
730      with:
731        arch: x86
732
733    - name: Prepare env
734      run: python -m pip install -r tests/requirements.txt --prefer-binary
735
736    # First build - C++11 mode and inplace
737    - name: Configure ${{ matrix.args }}
738      run: >
739        cmake -S . -B build
740        -G "Visual Studio 16 2019" -A Win32
741        -DPYBIND11_WERROR=ON
742        -DDOWNLOAD_CATCH=ON
743        -DDOWNLOAD_EIGEN=ON
744        ${{ matrix.args }}
745    - name: Build C++11
746      run: cmake --build build -j 2
747
748    - name: Run tests
749      run: cmake --build build -t pytest
750
751  win32-msvc2015:
752    name: "�� ${{ matrix.python }} • MSVC 2015 • x64"
753    runs-on: windows-latest
754    strategy:
755      fail-fast: false
756      matrix:
757        python:
758          - 2.7
759          - 3.6
760          - 3.7
761          # todo: check/cpptest does not support 3.8+ yet
762
763    steps:
764    - uses: actions/checkout@v2
765
766    - name: Setup �� ${{ matrix.python }}
767      uses: actions/setup-python@v2
768      with:
769        python-version: ${{ matrix.python }}
770
771    - name: Update CMake
772      uses: jwlawson/actions-setup-cmake@v1.7
773
774    - name: Prepare MSVC
775      uses: ilammy/msvc-dev-cmd@v1
776      with:
777        toolset: 14.0
778
779    - name: Prepare env
780      run: python -m pip install -r tests/requirements.txt --prefer-binary
781
782    # First build - C++11 mode and inplace
783    - name: Configure
784      run: >
785        cmake -S . -B build
786        -G "Visual Studio 14 2015" -A x64
787        -DPYBIND11_WERROR=ON
788        -DDOWNLOAD_CATCH=ON
789        -DDOWNLOAD_EIGEN=ON
790
791    - name: Build C++14
792      run: cmake --build build -j 2
793
794    - name: Run all checks
795      run: cmake --build build -t check
796
797
798  win32-msvc2017:
799    name: "�� ${{ matrix.python }} • MSVC 2017 • x64"
800    runs-on: windows-2016
801    strategy:
802      fail-fast: false
803      matrix:
804        python:
805          - 2.7
806          - 3.5
807          - 3.7
808        std:
809          - 14
810
811        include:
812          - python: 2.7
813            std: 17
814            args: >
815              -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR"
816
817    steps:
818    - uses: actions/checkout@v2
819
820    - name: Setup �� ${{ matrix.python }}
821      uses: actions/setup-python@v2
822      with:
823        python-version: ${{ matrix.python }}
824
825    - name: Update CMake
826      uses: jwlawson/actions-setup-cmake@v1.7
827
828    - name: Prepare env
829      run: python -m pip install -r tests/requirements.txt --prefer-binary
830
831    # First build - C++11 mode and inplace
832    - name: Configure
833      run: >
834        cmake -S . -B build
835        -G "Visual Studio 15 2017" -A x64
836        -DPYBIND11_WERROR=ON
837        -DDOWNLOAD_CATCH=ON
838        -DDOWNLOAD_EIGEN=ON
839        -DCMAKE_CXX_STANDARD=${{ matrix.std }}
840        ${{ matrix.args }}
841
842    - name: Build ${{ matrix.std }}
843      run: cmake --build build -j 2
844
845    - name: Run all checks
846      run: cmake --build build -t check
847