Merge branch 'main' into restore_msan #233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Format | |
on: push | |
jobs: | |
run: | |
name: Format with clang-format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang-format | |
- name: Execute formatter | |
run: | | |
export CPP_SRC_FILES=$(find ./lib -name "*.*" | grep -E "(\.cc$|\.cpp$|\.h$|\.hpp$)") | |
export CPP_SRC_FILES="$CPP_SRC_FILES $(find ./app -name "*.*" | grep -E "(\.cc$|\.cpp$|\.h$|\.hpp$)")" | |
export CPP_SRC_FILES="$CPP_SRC_FILES $(find ./test -name "*.*" | grep -E "(\.cc$|\.cpp$|\.h$|\.hpp$)")" | |
if [ -n "$CPP_SRC_FILES" ]; then clang-format --style=Google -i $CPP_SRC_FILES; fi; | |
- name: Commit changes | |
uses: Endbug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: 'Auto Format' | |
add: '*.*' |