aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-02-13 08:34:47 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-02-13 10:02:14 -0500
commitffccde447fd9d1e63f1b74a5ccdb96eecc3d7817 (patch)
treeeaa3813439dd6390df2c518bcc28f9490227c1ff /.github
parent225566e1f6586b15d5824d0fe54efafc765cbb1c (diff)
downloadstasis-ffccde447fd9d1e63f1b74a5ccdb96eecc3d7817.tar.gz
Create cmake-multi-platform.yml
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/cmake-multi-platform.yml53
1 files changed, 53 insertions, 0 deletions
diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml
new file mode 100644
index 0000000..125e068
--- /dev/null
+++ b/.github/workflows/cmake-multi-platform.yml
@@ -0,0 +1,53 @@
+name: CMake on multiple platforms
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ fail-fast: false
+
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ build_type: [RelWithDebInfo]
+ c_compiler: [gcc, clang]
+ include:
+ - os: macos-latest
+ c_compiler: clang
+ - os: ubuntu-latest
+ c_compiler: gcc
+ - os: ubuntu-latest
+ c_compiler: clang
+ exclude:
+ - os: macos-latest
+ c_compiler: gcc
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set reusable strings
+ id: strings
+ shell: bash
+ run: |
+ echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
+
+ - name: Configure CMake
+ run: >
+ cmake -B ${{ steps.strings.outputs.build-output-dir }}
+ -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+ -S ${{ github.workspace }}
+
+ - name: Build
+ run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
+
+ # TODO: Write ctests
+ #- name: Test
+ # working-directory: ${{ steps.strings.outputs.build-output-dir }}
+ # run: ctest --build-config ${{ matrix.build_type }}