aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 }}