Skip to content

Add GitHub workflows for clang-format and DCO checks - #2

Merged
bullekeup merged 4 commits into
mainfrom
gh-actions
Jul 29, 2026
Merged

bullekeup merged 4 commits into
mainfrom
gh-actions

Conversation

@po3ts

@po3ts po3ts commented Jul 13, 2026

Copy link
Copy Markdown
Member

This PR adds two workflows: one verifying compliance with the coding style guidelines, the other checking that contributors affirm the DCO. Both are invoked on pull requests.

  • The clang-format.yml workflow runs clang-format (v21.1.8) on all C source/header files touched by the PR and emits a warning annotation for each file that does not comply with the coding style guidelines. This workflow is advisory only and never blocks merging.
  • The developercertificate.yml workflow checks that every non-merge commit in the PR includes a trailing Signed-off-by: name <email> line. If any commit is missing the DCO sign-off, the check fails and blocks merging.

po3ts added 3 commits July 11, 2026 11:04
Signed-off-by: Alexander Poets <a.poets@ostfalia.de>
Signed-off-by: Alexander Poets <a.poets@ostfalia.de>
Signed-off-by: Alexander Poets <a.poets@ostfalia.de>
@po3ts
po3ts requested a review from a team as a code owner July 13, 2026 06:53
@po3ts po3ts self-assigned this Jul 13, 2026
Comment thread .github/workflows/clang-format.yml Outdated
with:
python-version: "3.x"

- run: pip install clang-format==21.1.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note, Zephyr uses latest clang-format which is currently lang-format 22.1.5.

Comment thread .github/workflows/clang-format.yml Outdated
Comment on lines +26 to +27
files=$(git diff --name-only --diff-filter=ACMR "$BASE_SHA" HEAD -- '*.c' '*.h')
for f in $files; do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we pin, we can just as well run it on the full code base. (But once the git just-check-modified-files mechanism here is set up, no harm in keeping CI time low).

- env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a GitHub built-in tool at https://github.com/apps/dco, but it's good preparation to move off GitHub. (We'll still have to change the CI format, but the core of this can stay).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I am aware, the built-in DCO tool requires each commit to carry a sign-off whose name and email match the commit's author identity. I deliberately dropped that requirement, as I myself commit using my users.noreply.github.com address but sign off with my actual work email.

Signed-off-by: Alexander Poets <a.poets@ostfalia.de>

@bullekeup bullekeup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me !

@bullekeup
bullekeup merged commit fc79a83 into main Jul 29, 2026
2 checks passed
@po3ts
po3ts deleted the gh-actions branch September 26, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants