-
Notifications
You must be signed in to change notification settings - Fork 23
47 lines (41 loc) · 1.31 KB
/
clang-format.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
45
46
47
name: ClangFormat Linter
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
jobs:
clangformat:
runs-on: ubuntu-latest
name: ClangFormat
steps:
- name: Clone Repository (for push events)
if: ${{ github.event_name == 'push' }}
# regular checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Clone Repository (for PR events)
if: ${{ github.event_name == 'pull_request' }}
# PR checkout
uses: actions/checkout@v3
with:
# checkout the repository the branch is coming from
repository: ${{ github.event.pull_request.head.repo.full_name }}
# prevent checkout in detached head state
ref: ${{ github.event.pull_request.head.ref }}
submodules: recursive
- name: Run ClangFormat
uses: DoozyX/[email protected]
with:
source: 'include test experiments'
extensions: 'hpp,cpp'
clangFormatVersion: 16
inplace: True
- uses: EndBug/add-and-commit@v9
with:
add: 'include test experiments'
commit: '--signoff'
message: ':art: ClangFormat changes'
author_name: ClangFormat
author_email: [email protected]