Skip to content

Commit

Permalink
add clang-format to github action
Browse files Browse the repository at this point in the history
Signed-off-by: peter <[email protected]>
  • Loading branch information
peter5232 committed Aug 8, 2023
1 parent a9db5df commit 2eeb9e9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "format code"

# run on pull requests to develop
on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# check out HEAD on the branch
ref: ${{ github.head_ref }}
# make sure the parent commit is grabbed as well, because
# that's what will get formatted (i.e. the most recent commit)
fetch-depth: 2
# format the latest commit
- uses: purduesigbots/clang-format-action@1
# use one of clang-format's supported styles or leave this out to use the style in your .clang-format file
with:
style: .clang-format
# commit the changes (if there are any)
- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: apply clang-format changes
branch: ${{ github.head_ref }}

0 comments on commit 2eeb9e9

Please sign in to comment.