Skip to content

Adds clang format config and CI steps #38

Adds clang format config and CI steps

Adds clang format config and CI steps #38

Workflow file for this run

name: CMake
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
format:
name: Check C++ Code Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Format
run: 'find test/ examples/ include/ -iname "*.h" -o -iname "*.cpp" -print0 | xargs -0 clang-format --dry-run --Werror'
build:
name: "${{matrix.config.name}} C++${{matrix.cxx}}"
runs-on: ${{matrix.config.os}}
strategy:
matrix:
config:
- os: ubuntu-latest
name: Ubuntu Debug
build_type: Debug
- os: ubuntu-latest
name: Ubuntu Release
build_type: Release
- os: windows-latest
name: Windows Debug
build_type: Debug
- os: windows-latest
name: Windows Release
build_type: Release
- os: macos-latest
name: Mac OS Debug
build_type: Debug
- os: macos-latest
name: Mac OS Release
build_type: Release
cxx:
- 11
- 17
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: cmake -S . -B ${{runner.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DBUILD_TESTS=True -DBUILD_EXAMPLES=True -DINICPP_CXX_STANDARD=${{matrix.cxx}}
- name: Build
run: cmake --build ${{runner.workspace}}/build --config ${{matrix.config.build_type}}
- name: Test
run: ctest -C ${{matrix.config.build_type}} --test-dir ${{runner.workspace}}/build