clang-format and clang-tidy #860
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: OpenTurbine-CI | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '.github/workflows/deploy_docs.yaml' | |
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] | |
build_external: [all, none] | |
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@18 | |
spack install cppcheck | |
spack install netcdf-c~mpi | |
spack install yaml-cpp | |
spack install trilinos@master~mpi~epetra ^kokkos-kernels+blas+lapack | |
- 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 netcdf-c~mpi | |
spack load yaml-cpp | |
cd openturbine | |
mkdir build | |
cd build | |
cmake .. \ | |
-DOpenTurbine_ENABLE_SANITIZER_ADDRESS=${{ matrix.build_external == 'none' }} \ | |
-DOpenTurbine_ENABLE_SANITIZER_UNDEFINED=${{ matrix.build_external == 'none' }} \ | |
-DOpenTurbine_ENABLE_CPPCHECK=ON \ | |
-DOpenTurbine_ENABLE_CLANG_TIDY=ON \ | |
-DOpenTurbine_WARNINGS_AS_ERRORS=ON \ | |
-DOpenTurbine_BUILD_OPENFAST_ADI=${{ matrix.build_external == 'all' }} \ | |
-DOpenTurbine_BUILD_ROSCO_CONTROLLER=${{ matrix.build_external == 'all' }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
cmake --build . | |
ctest --output-on-failure |