Add CMake build support with cross-platform compatibility #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ master, cmake ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| # Original Makefile build (Linux only) | |
| makefile: | |
| name: Linux (Makefile) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build | |
| run: make all | |
| - name: Test | |
| run: make test | |
| # CMake builds (all platforms) | |
| cmake: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| name: Linux (CMake) | |
| cmake_generator: "Unix Makefiles" | |
| - os: macos-latest | |
| name: macOS (CMake) | |
| cmake_generator: "Unix Makefiles" | |
| - os: windows-latest | |
| name: Windows (CMake) | |
| cmake_generator: "Visual Studio 17 2022" | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: cmake -B build -G "${{ matrix.cmake_generator }}" | |
| - name: Build | |
| run: cmake --build build --config Release | |
| - name: Run Tests | |
| run: ctest --test-dir build -C Release --output-on-failure |