Add Github Actions for Format + Testing #6
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 | |
on: | |
push: | |
pull_request: | |
jobs: | |
clang-format: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
timeout-minutes: 1 | |
if: | | |
contains(github.event.pull_request.body, 'FORCE_TEST_ACTIONS') | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run : | | |
sudo apt-get update && sudo apt-get install -yq clang clang-format | |
- name: Run clang-format # Use pipx to get version that apt doesn't have by default | |
run: clang-format --dry-run -Werror --verbose \ | |
$(git diff --name-only origin/main HEAD -- '*.cc' '*.hh' '*.hpp' |