Skip to content

Transfer unit test files from regression->external directory + add al… #391

Transfer unit test files from regression->external directory + add al…

Transfer unit test files from regression->external directory + add al… #391

name: OpenTurbine-CI
on: push
jobs:
Correctness-MacOS:
runs-on: macos-latest
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_PARALLEL_LEVEL: 2
strategy:
fail-fast: false
matrix:
compiler: [g++, clang++]
build_type: [Release, Debug]
steps:
- name: Cache install Dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/spack
key: macos-spack
- name: Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
git clone https://github.com/spack/spack.git
source spack/share/spack/setup-env.sh
spack compiler find
spack external find
spack install googletest
spack install llvm
spack install cppcheck
spack install yaml-cpp
spack install vtk~mpi~opengl2
spack install trilinos@master~mpi~epetra
- name: Clone
uses: actions/checkout@v4
with:
submodules: true
path: openturbine
- name: Test OpenTurbine
run: |
# Find the gfortran compiler and set the FC environment variable
export FC=$(find /opt/homebrew/ -name gfortran | tr ' ' '\n' | grep "/gcc/.*gfortran")
source spack/share/spack/setup-env.sh
spack load llvm
spack load cppcheck
spack load trilinos
spack load googletest
spack load yaml-cpp
spack load vtk
cd openturbine
mkdir build
cd build
cmake .. \
-DOpenTurbine_ENABLE_SANITIZER_ADDRESS=ON \
-DOpenTurbine_ENABLE_SANITIZER_UNDEFINED=ON \
-DOpenTurbine_ENABLE_CPPCHECK=ON \
-DOpenTurbine_ENABLE_CLANG_TIDY=ON \
-DOpenTurbine_ENABLE_VTK=ON \
-DOpenTurbine_BUILD_OPENFAST_ADI=ON \
-DOpenTurbine_BUILD_ROSCO_CONTROLLER=ON \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build .
ctest --output-on-failure