-
Notifications
You must be signed in to change notification settings - Fork 16
35 lines (29 loc) · 968 Bytes
/
clangFormat.yaml
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
name: Check Clang Format
on: [push, pull_request]
jobs:
format:
name: "Check Clang Format"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: "Install clang-format-11"
run: |
sudo apt-get update
sudo apt-get install clang-format-11
- name: "Format Codes"
run: clang-format-11 -i src/*.cpp src/*/*.cpp src/*/*.hpp tests/*.cpp tests/*.hpp
- name: Check diff
run: git diff --exit-code HEAD
- name: Create Pull Request
if: failure()
uses: peter-evans/create-pull-request@v6
with:
commit-message: "style: Format codes"
title: "style: format codes for ${{ github.ref }}"
labels: "auto-pr/style"
assignees: "${{ github.actor }}"
reviewers: "${{ github.actor }}"
branch: "auto-pr/clang-format/${{ github.ref }}"