fix(improvement): enhance usability #51
Workflow file for this run
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: 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 clang-format-14 | |
build-dir: build-gcc | |
- os: macos-latest | |
compiler: Clang | |
install: "brew install ninja clang-format" | |
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: Check Format | |
if: runner.os != 'Windows' | |
run: | | |
cmake --build ${{ matrix.build-dir }} --target check-format | |
- name: Example | |
run: | | |
cmake --build ${{ matrix.build-dir }} --target example |