activate CI tests on dev branch #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [ main, dev ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu", "macos", "windows" ] | |
cmake: [ "3.20", "3.25" ] | |
pytest: [ "6", "7" ] | |
python: [ "3.7", "3.8", "3.9", "3.10" ] | |
bundled: [ false, true ] | |
name: | | |
Pytest v${{ matrix.pytest }} | |
| CMake v${{ matrix.cmake }} | |
| ${{ matrix.os }}-py${{ matrix.python }} | |
| bundled: ${{ matrix.bundled }} | |
runs-on: "${{ matrix.os }}-latest" | |
env: | |
BUNDLE_PYTHON_TESTS: ${{ matrix.bundled }} | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "${{ matrix.python }}" | |
- uses: actions/checkout@v3 | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v1.13 | |
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@v1.13 | |
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: | |
platform: ${{ matrix.os }} | |
python: $(which python) | |
- name: Install pytest + pytest-cmake | |
run: pip install . pytest==${{ matrix.pytest }}.* | |
- name: Build Example | |
shell: bash | |
run: | | |
cmake --version | |
cmake \ | |
-DCMAKE_MODULE_PATH:FILEPATH="$(pwd)" \ | |
-S ./example \ | |
-B ./build | |
cmake --build ./build --config Release | |
- name: Run Tests | |
shell: bash | |
working-directory: build | |
run: ctest -VV | |