Skip to content

Add framework for benchmarks #4008

Add framework for benchmarks

Add framework for benchmarks #4008

name: Build and Test macOS
on:
push:
branches:
- main
- develop
pull_request:
paths:
- 'cmake/**'
- 'examples/**'
- 'src/**'
- 'thirdparty/**'
- 'tests/**'
- 'tools/profiling/**'
- 'CMakeLists.txt'
- 'extras/bindings/**'
- '.github/workflows/build-and-test-mac.yml'
workflow_dispatch:
concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
build:
name: ${{ format('{0} {1} {2}', matrix.CXX, matrix.CONFIG, matrix.TYPE) }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- CONFIG: MPIPETSc
CXX: 'clang '
TYPE: Debug
- CONFIG: MPIPETSc
CXX: 'clang '
TYPE: Release
steps:
- name: Check out preCICE
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
check-latest: true
- name: Install pip packages
run: pip3 install numpy polars
- name: Install preCICE dependencies
run: brew install --overwrite eigen libxml2 boost petsc openmpi ninja
- name: Generate build directory
run: mkdir -p build
- name: Configure
working-directory: build
env:
CXX: ${{ matrix.CXX }}
CXXFLAGS: "-Wall"
MPI: ${{ contains(matrix.CONFIG, 'MPI') }}
PETSc: ${{ contains(matrix.CONFIG, 'PETSc') }}
run: |
cmake --version
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ matrix.TYPE }} -DPRECICE_FEATURE_MPI_COMMUNICATION=${{ env.MPI }} -DPRECICE_FEATURE_PETSC_MAPPING=${{ env.PETSc }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja ..
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('{0} {1} {2}', matrix.CXX, matrix.CONFIG, matrix.TYPE) }} CMakeCache
path: build/CMakeCache.txt
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('{0} {1} {2}', matrix.CXX, matrix.CONFIG, matrix.TYPE) }} CMakeLogs
path: 'build/CMakeFiles/*.log'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('{0} {1} {2}', matrix.CXX, matrix.CONFIG, matrix.TYPE) }} CompileCommands
path: build/compile_commands.json
- name: Compile
working-directory: build
run: |
cmake --build .
- name: Tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
OMPI_MCA_btl: self,vader
OMPI_MCA_pml: ob1
working-directory: build
run: ctest -j
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ format('{0} {1} {2}', matrix.CXX, matrix.CONFIG, matrix.TYPE) }} TestOutput
path: build/TestOutput/