Skip to content

Add GitHub workflows #1

Add GitHub workflows

Add GitHub workflows #1

Workflow file for this run

name: "macOS"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "build-type=Release" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake
-B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++-12
-DCMAKE_C_COMPILER=gcc-12
-DCMAKE_BUILD_TYPE=${{ steps.strings.outputs.build-type }}
-S ${{ github.workspace }}
- name: Build
run: >
cmake
--build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ steps.strings.outputs.build-type }}
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ steps.strings.outputs.build-type }}