Freerb/242 update can drivers (#322) #440
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
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
clang_format_check: | |
name: Check Clang Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up clang-format | |
run: sudo apt-get install clang-format -y | |
- name: Fetch main branch | |
run: git fetch origin main:main | |
- name: Check code formatting | |
id: check_formatting | |
run: | | |
if git clang-format --style=file:firmware/.clang-format --diff $(git merge-base HEAD main) -v > clang_format_output.txt; then | |
echo "Code formatting is already correct." | |
else | |
echo "Code formatting changes detected." | |
cat clang_format_output.txt | |
exit 1 | |
fi |