Add cmake build code #2
This file contains 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: Build and Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
autotools: | |
strategy: | |
matrix: | |
include: | |
- description: "Ninja on Ubuntu" | |
cmake-preset: ninja | |
runs-on: ubuntu-latest | |
- description: "Ninja on OSX" | |
cmake-preset: ninja | |
runs-on: macos-13 | |
- description: "Ninja on Windows" | |
cmake-preset: ninja | |
runs-on: windows-latest | |
- description: "MSVC on Windows" | |
cmake-preset: msvc | |
runs-on: windows-latest | |
name: cmake workflow using ${{ matrix.description }} | |
runs-on: ${{ matrix.runs-on }} | |
permissions: | |
contents: read | |
steps: | |
- name: "Clone Repository" | |
uses: actions/checkout@v4 | |
- name: "Setup Ninja" | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build | |
run: | | |
cmake --preset ${{ matrix.cmake-preset }} | |
cmake --build --preset ${{ matrix.cmake-preset }}-release | |
working-directory: ${{ github.workspace }} | |
- name: Test | |
run: | | |
ctest --preset ${{ matrix.cmake-preset }}-release | |
working-directory: ${{ github.workspace }} | |
- name: Install | |
run: | | |
echo make install | |
working-directory: ${{ github.workspace }} |