Feature/add process raw imu (#13) #5
This file contains hidden or 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: clang-format check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
clang-format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Install clang-format | |
run: sudo apt-get install -y clang-format | |
- name: Run clang-format on C++ files | |
run: | | |
find . -name '*.cpp' -o -name '*.h' | xargs clang-format -i | |
- name: Check for changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
if [[ `git status --porcelain` ]]; then | |
git add . | |
git commit -m "Auto format code with clang-format" | |
git push origin HEAD:${{ github.head_ref }} | |
else | |
echo "No formatting needed" | |
fi |