Add pre-commit hooks and workflows for build and formatting #1
Workflow file for this run
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: Clang Format Check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
clang-format-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install clang-format | |
run: sudo apt update && sudo apt install -y clang-format | |
- name: Run clang-format Check on MediaProcessor | |
run: | | |
find MediaProcessor/src -regex '.*\.\(cpp\|h\)' -exec clang-format --dry-run --Werror {} + | |
- name: Display Message if Formatting Fails | |
if: failure() | |
run: echo "Code formatting issues found in MediaProcessor. Please run clang-format to fix them." |