Nymph2 2/workshop #199
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: Build and Test Nymph | |
on: | |
pull_request: | |
push: | |
branches: [main, develop] | |
tags: ['*'] | |
env: | |
Nymph_BUILD_NYMPH_EXE: ON | |
Nymph_ENABLE_EXECUTABLES: ON | |
Nymph_ENABLE_PYTHON: OFF | |
Nymph_ENABLE_TESTING: ON | |
Nymph_SINGLETHREADED: OFF | |
Nymph_BUILD_TYPE: Debug | |
Nymph_TAG: test | |
jobs: | |
docker_build: | |
name: Build and Test in Docker | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Build and test | |
run: | | |
docker build \ | |
--target nymph_done \ | |
--build-arg img_repo=${BASE_IMAGE_REPO} \ | |
--build-arg img_tag=${BASE_IMAGE_TAG} \ | |
--build-arg build_type=${Nymph_BUILD_TYPE} \ | |
--build-arg build_tests_exe=${Nymph_ENABLE_TESTING} \ | |
--build-arg nymph_tag=${Nymph_TAG} \ | |
--tag project8/nymph:${Nymph_TAG} \ | |
. | |
docker run project8/nymph:${Nymph_TAG} /tmp_source/build/Testing/RunTests | |
build_cpp: | |
name: Build and Test Cpp | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macOS-10.15] | |
python-version: [3.9] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Mac Dependencies | |
if: startsWith(matrix.os, 'macos') # Mac only | |
run: | | |
brew install \ | |
boost \ | |
rapidjson \ | |
yaml-cpp \ | |
pybind11 | |
- name: Linux Dependencies | |
if: startsWith(matrix.os, 'ubuntu') # Linux only | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq \ | |
libboost-all-dev \ | |
libyaml-cpp-dev \ | |
rapidjson-dev \ | |
pybind11-dev | |
pip install "pybind11[global]" | |
- name: Configure CMake | |
run: | | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=${Nymph_BUILD_TYPE} -DNymph_BUILD_NYMPH_EXE=${Nymph_BUILD_NYMPH_EXE} -DNymph_ENABLE_EXECUTABLES=${Nymph_ENABLE_EXECUTABLES} -DNymph_ENABLE_PYTHON=${Nymph_ENABLE_PYTHON} -DNymph_ENABLE_TESTING=${Nymph_ENABLE_TESTING} -DNymph_SINGLETHREADED=${Nymph_SINGLETHREADED} .. | |
- name: CMake Build | |
run: | | |
cd build | |
make -j install | |
- name: Run tests | |
run: | | |
cd build | |
Testing/RunTests | |
build_python: | |
name: Build and Test Python | |
runs-on: ${{ matrix.os }} | |
env: | |
Nymph_ENABLE_PYTHON: ON | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macOS-10.15] | |
python-version: [3.9] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Mac Dependencies | |
if: startsWith(matrix.os, 'macos') # Mac only | |
run: | | |
brew install \ | |
boost \ | |
rapidjson \ | |
yaml-cpp \ | |
pybind11 | |
python -m pip install build | |
- name: Linux Dependencies | |
if: startsWith(matrix.os, 'ubuntu') # Linux only | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq \ | |
libboost-all-dev \ | |
libyaml-cpp-dev \ | |
rapidjson-dev | |
pip install "pybind11[global]" | |
python -m pip install build | |
- name: Install nymph | |
run: | | |
pip -v install . | |
- name: Run Tests | |
run: | | |
cd Testing/Python | |
python -m unittest discover -v | |