-
Notifications
You must be signed in to change notification settings - Fork 592
44 lines (40 loc) · 1017 Bytes
/
lint-cpp.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
name: Lint cpp
on:
push:
branches:
- 'dev'
paths:
- '**.h'
- '**.cc'
- '**.cpp'
- '**.proto'
- '**.java'
tags-ignore:
- '**'
pull_request:
paths:
- '**.h'
- '**.cc'
- '**.cpp'
- '**.proto'
- '**.java'
jobs:
cpp:
name: Lint files with clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run clang-format
run: |
docker run \
-v $PWD:/redpanda ubuntu \
bash -c "cd /redpanda && \
apt update && \
apt install -y wget git lsb-release wget software-properties-common gnupg && \
wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 16 && \
apt-get install -y clang-format-16 && \
find . -type f -regex '.*\.\(cpp\|h\|hpp\|cc\|proto\|java\)' | xargs -n1 clang-format-16 -i -style=file -fallback-style=none"
git diff --exit-code