-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.94 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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