-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (82 loc) · 2.72 KB
/
Copy pathcode-quality.yml
File metadata and controls
93 lines (82 loc) · 2.72 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
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
name: Code Quality
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: code-quality-${{ github.ref }}
cancel-in-progress: true
jobs:
clang-format:
name: clang-format check
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format-18
- name: Check formatting
run: |
find include src tests examples benchmarks tools \
-type f \( -name "*.hpp" -o -name "*.cpp" \) \
-print0 | xargs -0 clang-format-18 --dry-run --Werror -style=file
clang-tidy:
name: clang-tidy static analysis
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ${{ matrix.cc }} ${{ matrix.cxx }}
if [ "${{ matrix.compiler }}" = "clang" ]; then
sudo apt-get install -y libc++-18-dev libc++abi-18-dev
fi
- name: Install libc++
run: sudo apt-get install -y libc++-18-dev libc++abi-18-dev
- name: Configure CMake (generate compile_commands.json)
env:
CC: clang-18
CXX: clang++-18
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DRMG_BUILD_TESTS=OFF \
-DRMG_BUILD_EXAMPLES=OFF \
-DRMG_BUILD_TOOLS=OFF \
-DCMAKE_CXX_FLAGS=-stdlib=libc++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy on library sources
run: |
find src -type f -name "*.cpp" -not -path "src/platform/windows/*" -print0 | \
xargs -0 clang-tidy-18 -p build --quiet
sanitizers:
name: ASan + UBSan test run
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-18 libc++-18-dev libc++abi-18-dev
- name: Configure CMake with sanitizers
env:
CC: clang-18
CXX: clang++-18
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DRMG_BUILD_TESTS=ON \
-DRMG_BUILD_EXAMPLES=OFF \
-DRMG_BUILD_TOOLS=OFF \
-DRMG_ENABLE_SANITIZERS=ON \
-DCMAKE_CXX_FLAGS=-stdlib=libc++
- name: Build
run: cmake --build build --parallel
- name: Run tests under sanitizers
working-directory: build
run: ctest --output-on-failure --parallel 2