Skip to content

Add cmake build system #37

Add cmake build system

Add cmake build system #37

Workflow file for this run

name: CMake Build and Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release]
shared_libs: [ON, OFF]
fortran: [OFF]
include:
# Add a Fortran build on each platform (shared only)
- os: ubuntu-latest
build_type: Release
shared_libs: ON
fortran: ON
- os: macos-latest
build_type: Release
shared_libs: ON
fortran: ON
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libyaml-dev gfortran
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install libyaml gcc
- name: Configure
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }}
-DAST_BUILD_FORTRAN=${{ matrix.fortran }}
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --output-on-failure