docpp/.github/workflows/cmake-multi-platform.yml

51 lines
1.3 KiB
YAML
Raw Normal View History

2024-05-06 00:31:29 +02:00
name: Windows, macOS, Ubuntu CI
2024-05-05 23:51:02 +02:00
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
2024-05-06 00:31:29 +02:00
fail-fast: true
2024-05-05 23:51:02 +02:00
matrix:
2024-05-06 00:11:39 +02:00
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Release]
2024-05-05 23:51:02 +02:00
include:
- os: windows-latest
cpp_compiler: cl
- os: ubuntu-latest
2024-05-06 00:06:06 +02:00
cpp_compiler: clang++
- os: macos-latest
cpp_compiler: clang++
2024-05-05 23:51:02 +02:00
steps:
- uses: actions/checkout@v4
- 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_CXX_COMPILER=${{ matrix.cpp_compiler }}
-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 }}
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}