Skip to content

feat(add): support FetchContent for cmake #43

feat(add): support FetchContent for cmake

feat(add): support FetchContent for cmake #43

Workflow file for this run

name: CMake CI Matrix
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
name: Build and Test on ${{ matrix.os }} with ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
compiler: GCC
install: sudo apt-get update && sudo apt-get install -y build-essential ninja-build
build-dir: build-gcc
- os: macos-latest
compiler: Clang
install: "brew install ninja"
build-dir: build-clang
- os: windows-latest
compiler: MSVC
install: "choco install ninja"
build-dir: build-msvc
steps:
- uses: actions/checkout@v4
- name: Setup MSVC Dev Environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
run: ${{ matrix.install }}
- name: Configure
run: |
cmake -B ${{ matrix.build-dir }} -G Ninja
- name: Build
run: |
cmake --build ${{ matrix.build-dir }}
- name: Test
run: |
cmake --build ${{ matrix.build-dir }} --target run-tests
- name: Example
run: |
cmake --build ${{ matrix.build-dir }} --target example