Skip to content

Merge pull request #104 from OpenNavigationSurface/90-how-do-you-open… #292

Merge pull request #104 from OpenNavigationSurface/90-how-do-you-open…

Merge pull request #104 from OpenNavigationSurface/90-how-do-you-open… #292

Workflow file for this run

name: Test Matrix
on:
push:
paths-ignore:
- 'docs/**'
- readme.*
- README.*
- '*.md'
- '*.svg'
- '*.png'
- .github/workflows/testwindows.yml
branches: [ "master" ]
pull_request:
paths-ignore:
- 'docs/**'
- readme.*
- README.*
- '*.md'
- '*.svg'
- '*.png'
- .github/workflows/testwindows.yml
branches: [ "master" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CC: gcc
CXX: g++
jobs:
build:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-20.04]
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
bash ./scripts/install-dependencies.sh ${{github.workspace}} ${{matrix.python-version}}
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
export CC=${{env.CC}}
export CXX=${{env.CXX}}
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -B build -S . -DCMAKE_INSTALL_PREFIX=/usr -DBAG_BUILD_TESTS:BOOL=ON
- name: Build
# Build your program with the given configuration
run: |
export CC=${{env.CC}}
export CXX=${{env.CXX}}
cmake --build build
python -m pip wheel -w ./wheel/ ./build/api/swig/python
- name: Install
# Install into conda environment
run: |
sudo cmake --install build
source python-venv/bin/activate
python -m pip install ./wheel/bagPy-*.whl
deactivate
- name: Tests
# Execute C++ and Python tests
run: |
BAG_SAMPLES_PATH=${{github.workspace}}/examples/sample-data ./build/tests/bag_tests
source python-venv/bin/activate
BAG_SAMPLES_PATH=${{github.workspace}}/examples/sample-data python -m pytest --cov=bagPy --cov-branch --cov-report=xml --junitxml=python-test-results.xml python/test_*.py
deactivate