Skip to content

Combine workflows into one github workflow file #1

Combine workflows into one github workflow file

Combine workflows into one github workflow file #1

name: Build and Test
on:
pull_request:
branches: [ main ]
schedule:
- cron: '0 12 * * FRI'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
defaults:
run:
shell: bash -l {0}
env:
ENV_DIR: /usr/share/miniconda3/envs/test-env/
QT_QPA_PLATFORM: offscreen
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
environment-file: conda/testing.yml
activate-environment: test-env
- name: Build & Install Project
run: |
cmake --preset=ninja -DPYTHON_EXECUTABLE=$ENV_DIR/bin/python -Dpybind11_DIR=$ENV_DIR/share/cmake/pybind11 -DCMAKE_INSTALL_PREFIX=$ENV_DIR -DCMAKE_INSTALL_LIBDIR=$ENV_DIR/lib/python3.8/site-packages .
cd ../build
ninja
ninja install
$ENV_DIR/bin/python -m pip install --ignore-installed ../N-Body-Simulations
- name: Cpp Unit Tests
env:
TESTPATH: ${{ github.workspace }}/../build/tests/unit_tests/cpp
run: |
$TESTPATH/NBodySimulationsUnitTests
- name: Cpp System Tests
env:
TESTPATH: ${{ github.workspace }}/../build/tests/system_tests/cpp
run: |
$TESTPATH/NBodySimulationsSystemTests
- name: Python Unit Tests
run: |
coverage run -m pytest tests/unit_tests/python/
- name: Report Unit Test Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
coverage report
- name: Python System Tests
run: |
pytest tests/system_tests/python/