-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (45 loc) · 1.78 KB
/
Copy pathcpp-precommit.yml
File metadata and controls
58 lines (45 loc) · 1.78 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
name: C++ Pre-commit Checks
on:
push:
branches: [main, develop]
paths:
- "src/cpp/**"
- ".pre-commit-config.yaml"
- ".github/workflows/cpp-precommit.yml"
pull_request:
branches: [main, develop]
paths:
- "src/cpp/**"
- ".pre-commit-config.yaml"
- ".github/workflows/cpp-precommit.yml"
jobs:
cpp-precommit:
name: Run C++ pre-commit hooks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-format cppcheck
- name: Install pre-commit
run: python -m pip install --upgrade pip pre-commit
- name: Run clang-format hook
run: pre-commit run clang-format --all-files --show-diff-on-failure --color=always
- name: Run cpplint hook
run: pre-commit run cpplint --all-files --show-diff-on-failure --color=always
- name: Run cppcheck hook
run: pre-commit run cppcheck --all-files --show-diff-on-failure --color=always
- name: Run no-dynamic-allocation hook
run: pre-commit run no-dynamic-allocation --all-files --show-diff-on-failure --color=always
- name: Run no-locks-in-latency-critical hook
run: pre-commit run no-locks-in-latency-critical --all-files --show-diff-on-failure --color=always
- name: Run no-syscalls-in-hot-loop hook
run: pre-commit run no-syscalls-in-hot-loop --all-files --show-diff-on-failure --color=always
- name: Run check-atomic-usage hook
run: pre-commit run check-atomic-usage --all-files --show-diff-on-failure --color=always