update test job #77
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: | |
branches: | |
- master | |
- develop | |
pull_request: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
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 } | |
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 }} | |
format: | |
name: Formatting | |
runs-on: ubuntu-22.04 | |
env: | |
CLANG_FORMAT_VERSION: 17 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Clang-Format | |
uses: aminya/setup-cpp@v1 | |
with: | |
clangformat: ${{ env.CLANG_FORMAT_VERSION }} | |
- 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 |