Skip to content

Commit ae74a5d

Browse files
committed
ci: enable GHA testing
Adds requirements file too.
1 parent 4ee282e commit ae74a5d

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
- stable
10+
- v*
11+
12+
jobs:
13+
standard:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu, windows, macos]
18+
python:
19+
- 2.7
20+
- 3.5
21+
- 3.6
22+
- 3.7
23+
- 3.8
24+
- pypy2
25+
- pypy3
26+
- 3.9-dev
27+
28+
exclude:
29+
# Currently 32bit only, and we build 64bit
30+
- os: windows
31+
python: pypy2
32+
- os: windows
33+
python: pypy3
34+
35+
# Currently can't build due to warning, fixed in CPython > 3.9b5
36+
- os: macos
37+
python: 3.9-dev
38+
39+
# Currently broken on embed_test
40+
- os: windows
41+
python: 3.8
42+
- os: windows
43+
python: 3.9-dev
44+
45+
name: Python ${{ matrix.python }} on ${{ matrix.os }}
46+
runs-on: ${{ matrix.os }}-latest
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
51+
- name: Setup Python ${{ matrix.python }}
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: ${{ matrix.python }}
55+
56+
- name: Prepare env
57+
run: python -m pip install -r tests/requirements.txt
58+
59+
- name: Configure
60+
shell: bash
61+
run: >
62+
cmake -S . -B build
63+
-DPYBIND11_WERROR=ON
64+
-DDOWNLOAD_CATCH=ON
65+
-DPYTHON_EXECUTABLE=$(python -c "import sys; print(sys.executable)")
66+
67+
- name: Build
68+
run: cmake --build build -j 2
69+
70+
- name: Python tests
71+
run: cmake --build build --target pytest -j 2 -v
72+
73+
- name: C++ tests
74+
run: cmake --build build --target cpptest -j 2 -v
75+
76+
- name: Interface test
77+
run: cmake --build build --target test_cmake_build

tests/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
numpy
2+
pytest

0 commit comments

Comments
 (0)