Skip to content

Version 3 - Failsafe Polyhedral Gravity Modeling & Polyhedron Class #73

Version 3 - Failsafe Polyhedral Gravity Modeling & Polyhedron Class

Version 3 - Failsafe Polyhedral Gravity Modeling & Polyhedron Class #73

Workflow file for this run

name: Build & Test
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build the C++ library & test that it is working using GoogleTest
build-and-test-cpp:
name: C/C++ Library on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
- name: Test (Linux & macOS)
run: cd build/test && ./polyhedralGravity_test
if: matrix.os != 'windows-latest'
# Problems with resources (test file) location leads to test failure
# - name: Test (Windows)
# run: cd build/test/Release && .\polyhedralGravity_test.exe
# if: matrix.os == 'windows-latest'
# Install the python interface & test that it is working using pytest
build-and-test-python:
name: Python Interface on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
- name: Install Conda environment from environment.yml
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
cache-downloads: true
cache-env: true
- name: Install & Test polyhedral-gravity
shell: bash -l {0}
run: |
pip install . -vv --no-build-isolation
pytest -n 3