Skip to content

Update CMakeLists.txt #96

Update CMakeLists.txt

Update CMakeLists.txt #96

Workflow file for this run

name: ci
on:
push:
branches:
- master
- develop
pull_request:
release:
types: [published]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-22.04
env:
CLANG_FORMAT_VERSION: 17
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Clang-Format
uses: aminya/setup-cpp@v1
with:
clangformat: ${{ env.CLANG_FORMAT_VERSION }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install codespell
run: pip3 install codespell
- name: Format Code
run: cmake -DCLANG_FORMAT_EXECUTABLE=clang-format-${{ env.CLANG_FORMAT_VERSION }} -P cmake/Format.cmake
- name: Check Formatting
run: git diff --color --exit-code
- name: Spell Check
if: always()
run: cmake -P cmake/CodeSpell.cmake
- name: Format Vcpkg.json
if: always()
run: vcpkg format-manifest ./vcpkg.json
test:
needs: [lint]
name: ${{ matrix.platform.os }} ${{ matrix.platform.generator }} ${{ matrix.platform.compiler }} ${{ matrix.config.name }} ${{ matrix.type.name }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ${{ matrix.platform.os }}
timeout-minutes: 120
strategy:
fail-fast: false
# https://github.com/actions/runner-images
matrix:
platform:
- { os: windows-2022, generator: vs2022, compiler: msvc, preset: windows-vs2022 }
- { os: windows-2022, generator: vs2022, compiler: llvm, preset: windows-vs2022-clangcl }
- { os: windows-2022, generator: ninja, compiler: msvc, preset: windows-ninja }
- { os: windows-2022, generator: ninja, compiler: llvm, preset: windows-ninja-clangcl }
- { os: ubuntu-22.04, generator: ninja, compiler: gcc, preset: linux-ninja-gcc }
- { os: ubuntu-22.04, generator: ninja, compiler: llvm, preset: linux-ninja-clang }
- { os: macos-13, generator: ninja, compiler: llvm, preset: mac-ninja-clang }
- { os: macos-13, generator: xcode, compiler: llvm, preset: mac-xcode-clang }
config:
- { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE }
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
type:
- { name: Debug, flags: -DCMAKE_BUILD_TYPE=Debug }
- { name: Release, flags: -DCMAKE_BUILD_TYPE=Release }
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Cpp Environment
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.platform.compiler }}
vcvarsall: ${{ contains(matrix.platform.os, 'windows') }}
cmake: true
ninja: true
vcpkg: true
clangtidy: true
cppcheck: true
- name: CMake Configure
env:
VCPKG_ROOT: '~/vcpkg'
shell: bash
run: cmake --preset=${{ matrix.platform.preset }} ${{ matrix.config.flags }} ${{ matrix.type.flags }} -DVCPKG_MANIFEST_FEATURES=tests -DFEATURE_TESTS=ON
- name: CMake Build
shell: bash
run: cmake --build --preset=${{ matrix.platform.preset }} --config ${{ matrix.type.name }}
- name: Test
shell: bash
run: ctest --preset=${{ matrix.platform.preset }} -C ${{ matrix.type.name }}