-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.53 KB
/
Copy pathci.yml
File metadata and controls
52 lines (49 loc) · 1.53 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { name: "gcc-14 Release", gcc: 14, sanitize: OFF }
- { name: "gcc-14 ASan+UBSan", gcc: 14, sanitize: ON }
steps:
- uses: actions/checkout@v4
- name: Install g++-${{ matrix.gcc }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y g++-${{ matrix.gcc }}
- name: Configure
run: |
cmake -B build \
-DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \
-DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \
-DCMAKE_BUILD_TYPE=Release \
-DHUB_SANITIZE=${{ matrix.sanitize }}
- name: Build
run: cmake --build build -j$(nproc)
- name: Test
run: ctest --test-dir build --output-on-failure
clang-tidy:
name: clang-tidy (report)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy cmake g++
- name: Configure (compile_commands.json,不拉测试依赖)
run: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DHUB_BUILD_TESTS=OFF
- name: Run clang-tidy
run: |
FILES=$(find src -name '*.cpp' -not -path '*/test/*')
echo "Checking:" $FILES
clang-tidy -p build $FILES