-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to validate clang-format was applied to core's sources. (#…
…184)
- Loading branch information
1 parent
2b72d5b
commit 164679f
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: clp-core-lint | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- ".github/workflows/clp-core-lint.yaml" | ||
- "components/core/src/**" | ||
- "components/core/tests/**" | ||
push: | ||
paths: | ||
- ".github/workflows/clp-core-lint.yaml" | ||
- "components/core/src/**" | ||
- "components/core/tests/**" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: "${{github.workflow}}-${{github.ref}}" | ||
# Cancel in-progress jobs for efficiency | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
clang-format: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
with: | ||
submodules: "recursive" | ||
|
||
- uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: "Install clang-format" | ||
shell: "bash" | ||
run: | | ||
pip3 install --upgrade pip | ||
pip3 install --upgrade clang-format | ||
- name: "Run clang-format on all of core's source files" | ||
shell: "bash" | ||
working-directory: "./components/core" | ||
run: | | ||
find src tests \ | ||
-type f \ | ||
\( -iname "*.cpp" -o -iname "*.h" -o -iname "*.hpp" -o -iname "*.inc" \) \ | ||
-print0 | \ | ||
xargs -0 clang-format --dry-run -Werror |