Skip to content

Commit

Permalink
Create cmake-multi-platform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OleErikPeistorpet committed Sep 11, 2023
1 parent b863828 commit e1caefd
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CMake on Ubuntu, MacOS

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop", "master" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release]
compiler: [g++]

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ github.workspace }}/build
-D CMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}/unit_test
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ github.workspace }}/build
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }}

0 comments on commit e1caefd

Please sign in to comment.