-
Notifications
You must be signed in to change notification settings - Fork 12
103 lines (90 loc) · 2.93 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI workflow
on: push
jobs:
cmakelint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- run: pip install cmakelint
- run: cmakelint `find . -name CMakeLists.txt`
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install -y cpplint
- run: cpplint --recursive .
build_and_test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
compiler:
- g++
- clang++
extra_check:
- ''
include:
- os: windows-latest
compiler: '' # default
gtest_root_flag: "-DGTEST_ROOT=D:/gtest"
- os: ubuntu-latest
compiler: clazy
extra_check: clazy
- os: ubuntu-latest
compiler: clang++
extra_check: clang-tidy
extra_check_flag: '-DCMAKE_CXX_CLANG_TIDY="/usr/bin/clang-tidy;-checks=*"'
- os: ubuntu-latest
compiler: clang++
extra_check: lwyu
extra_check_flag: '-DCMAKE_LINK_WHAT_YOU_USE=TRUE'
- os: ubuntu-latest
compiler: clang++
extra_check: iwyu
extra_check_flag: '-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/usr/bin/iwyu"'
runs-on: ${{ matrix.os }}
name: ${{ matrix.extra_check || join(matrix.*) }}
steps:
- uses: actions/checkout@v4
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install dependencies (linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -y install libgl1-mesa-dev qt6-base-dev libasound2-dev
- name: Install dependencies (macos)
if: matrix.os == 'macos-latest'
run: brew install qt6
- name: Install Qt6 (windows)
if: matrix.os == 'windows-latest'
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.6.0'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
- name: Install clang (linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -y install clang
- name: Install clang (macos)
if: matrix.os == 'macos-latest' && matrix.compiler == 'clang++'
run: brew install llvm
- name: Install clazy
if: matrix.compiler == 'clazy'
run: sudo apt-get -y install clazy
- name: Install clang-tidy
if: matrix.extra_check == 'cland-tidy'
run: sudo apt-get install -y clang-tidy
- name: Install IWYU
if: matrix.extra_check == 'iwyu'
run: sudo apt-get install -y iwyu
- name: Configure CMake
run: cmake -G Ninja . DCMAKE_CXX_COMPILER="${{ matrix.compiler }}" ${{matrix.extra_check_flag}}
- name: Build
run: cmake --build .
- name: Test
if: matrix.extra_check == ''
run: ctest