-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (71 loc) · 2.32 KB
/
test.yml
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
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Run tests once a week on Sunday.
schedule:
- cron: "0 6 * * 0"
jobs:
run-tests:
strategy:
fail-fast: false
matrix:
pytest: [ "7", "8" ]
cmake: [ "3.20", "3.30" ]
os: [ "ubuntu", "macos", "windows" ]
python: [ "3.8", "3.11", "3.12" ]
bundled: [ false, true ]
name: |
v${{ matrix.pytest }}-${{ matrix.cmake }}
[${{ matrix.os }}-py${{ matrix.python }}]
${{ matrix.bundled && '(bundled)' || '' }}
runs-on: "${{ matrix.os }}-latest"
env:
BUNDLE_PYTHON_TESTS: ${{ matrix.bundled }}
steps:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python }}"
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2.0
if: ${{matrix.os != 'windows' || matrix.cmake != '3.20'}}
with:
cmake-version: "${{ matrix.cmake }}.x"
- name: Setup cmake (Bump up CMake minimal version for Visual Studio 17 2022)
uses: jwlawson/actions-setup-cmake@v2.0
if: ${{matrix.os == 'windows' && matrix.cmake == '3.20'}}
with:
# Visual Studio 17 2022 requires at least CMake 3.21.
# https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html
cmake-version: "3.21.x"
- name: Install Boost Python
uses: ./.github/actions/install-boost-python
with:
python: ${{ matrix.python }}
path: ${{ runner.temp }}
- name: Install pytest + pytest-cmake
run: python3 -m pip install . pytest==${{ matrix.pytest }}.*
- name: Configure Example
shell: bash
run: |
cmake --version
cmake \
-D "CMAKE_BUILD_TYPE=Release" \
-D "Boost_ROOT=${{ runner.temp }}" \
-S ./example \
-B ./build
- name: Build without Python and Test
shell: bash
working-directory: build
run: |
cmake --build . --target foo CppTest --config Release
ctest -VV -C Release -R "CppTest"
- name: Build and Test
shell: bash
working-directory: build
run: |
cmake --build . --config Release
ctest -VV -C Release