Skip to content

Commit

Permalink
Add workflow to validate clang-format was applied to core's sources. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkrodrigues authored Dec 16, 2023
1 parent 2b72d5b commit 164679f
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/clp-core-lint.yaml
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

0 comments on commit 164679f

Please sign in to comment.