-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (33 loc) · 1.31 KB
/
post-push-checks.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
name: Post-push Checks
on: push
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2
- name: Run Bazel tests
run: |
bazel test //... --test_output=errors
Check-format:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2
- name: Install buildifier
run: |
wget https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildifier-linux-amd64
mv buildifier-linux-amd64 buildifier
chmod +x buildifier
- name: Run clang-format for .h and .c files
run: |
find . -name "*.h" -o -name "*.c" | xargs clang-format -i
git diff --exit-code || (echo "Code is not properly formatted (.h and .c files)." && exit 1)
- name: Run clang-format with Google style for .hpp ,.cc, and .cpp files
run: |
find . -name "*.hpp" -o -name "*.cc" -o -name "*.cpp" | xargs clang-format -i -style=Google
git diff --exit-code || (echo "Code is not properly formatted (.hpp, .cc, and .cpp files)." && exit 1)
- name: Run buildifier on Bazel files
run: |
./buildifier -r .
git diff --exit-code || (echo "Bazel files are not properly formatted." && exit 1)