Skip to content

Commit

Permalink
Combine workflows into one github workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
robertapplin committed Aug 20, 2023
1 parent 618b6b2 commit 8955566
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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/
1 change: 1 addition & 0 deletions conda/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencies:
- pre-commit
- pytest
- pytest-mock
- python=3.8.*
1 change: 1 addition & 0 deletions conda/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- ninja
- pybind11
- pyside2
- python=3.8.*
- pyqt
- pre-commit
- pytest
Expand Down

0 comments on commit 8955566

Please sign in to comment.