pybind11/.github/workflows/ci.yml

165 lines
4.0 KiB
YAML
Raw Normal View History

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- stable
- v*
jobs:
standard:
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python:
- 2.7
- 3.5
- 3.8
- 3.9-dev
- pypy2
- pypy3
include:
- os: ubuntu
python: 3.6
- os: macos
python: 3.7
exclude:
# Currently 32bit only, and we build 64bit
- os: windows
python: pypy2
- os: windows
python: pypy3
# Currently can't build due to warning, fixed in CPython > 3.9b5
- os: macos
python: 3.9-dev
# Currently broken on embed_test
- os: windows
python: 3.8
- os: windows
python: 3.9-dev
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
2020-07-24 15:45:22 +00:00
- name: Cache wheels
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v2
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-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Prepare env
run: python -m pip install -r tests/requirements.txt
2020-07-24 00:30:47 +00:00
- name: Configure C++11
shell: bash
run: >
2020-07-24 00:30:47 +00:00
cmake --version &&
cmake -S . -B build
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
2020-07-26 17:44:10 +00:00
-DDOWNLOAD_EIGEN=ON
2020-07-24 00:30:47 +00:00
-DCMAKE_CXX_STANDARD=11
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
- name: Build C++11
run: cmake --build build -j 2
- name: Python tests C++11
run: cmake --build build --target pytest -j 2 -v
- name: C++11 tests
run: cmake --build build --target cpptest -j 2 -v
- name: Interface test C++11
run: cmake --build build --target test_cmake_build
- name: Configure C++17
shell: bash
run: >
cmake -S . -B build17
-DPYBIND17_WERROR=ON
-DDOWNLOAD_CATCH=ON
2020-07-26 17:44:10 +00:00
-DDOWNLOAD_EIGEN=ON
2020-07-24 00:30:47 +00:00
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
2020-07-24 00:30:47 +00:00
- name: Build C++17
run: cmake --build build17 -j 2
- name: Python tests C++17
run: cmake --build build17 --target pytest
- name: C++17 tests
run: cmake --build build17 --target cpptest
- name: Interface test C++17
run: cmake --build build17 --target test_cmake_build
clang:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clang:
- 3.6
- 3.7
- 3.8
- 3.9
- 5
- 7
- 9
- dev
name: Clang ${{ matrix.clang }}
container: "silkeh/clang:${{ matrix.clang }}"
steps:
- uses: actions/checkout@v2
- name: Add wget and python3
2020-07-26 17:44:10 +00:00
run: apt-get update && apt-get install -y python3-dev python3-numpy python3-pytest libeigen3-dev
2020-07-24 00:30:47 +00:00
- name: Configure
shell: bash
run: >
cmake --version &&
cmake -S . -B build
-DPYBIND11_WERROR=ON
-DDOWNLOAD_CATCH=ON
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
- name: Build
run: cmake --build build -j 2
- name: Python tests
2020-07-24 00:30:47 +00:00
run: cmake --build build --target pytest
- name: C++ tests
2020-07-24 00:30:47 +00:00
run: cmake --build build --target cpptest
- name: Interface test
run: cmake --build build --target test_cmake_build