Add '.clang-tidy' #30
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: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: ${{ matrix.platform.name }} [${{ matrix.type.name }}] | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } | |
- { name: Linux GCC, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ } | |
- { name: Windows Clang, os: windows-2022, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G "Unix Makefiles" } | |
- { name: Windows VS, os: windows-2022, flags: -DUSE_SANITIZER=NO } | |
- { name: Windows VS ClangCL, os: windows-2022, flags: -T ClangCL -DUSE_SANITIZER=NO } | |
type: | |
- { name: Release, flags: -DCMAKE_BUILD_TYPE=Release } | |
- { name: Debug, flags: -DCMAKE_BUILD_TYPE=Debug } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure CMake | |
run: cmake -B build ${{ matrix.platform.flags }} ${{ matrix.type.flags }} | |
- name: Build | |
run: cmake --build build --config ${{ matrix.type.name }} | |
- name: Test | |
run: ctest --test-dir build/ --output-on-failure --build-config ${{ matrix.type.name }} -j 2 | |
clang-tidy: | |
name: Analyze code on ${{ matrix.platform.name }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { name: Windows, os: windows-2022, flags: -G "Unix Makefiles" } | |
- { name: Linux, os: ubuntu-latest, flags: -G "Unix Makefiles" } | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure CMake | |
run: > | |
cmake -B build ${{ matrix.platform.flags }} -DUSE_CLANG_TIDY=TRUE | |
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUSE_SANITIZER=FALSE -DCMAKE_BUILD_TYPE=Debug | |
- name: Analyze Code | |
run: cmake --build build --target clang-tidy |