Repository navigation
Add GitHub workflows for clang-format and DCO checks - #2
Conversation
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>
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - run: pip install clang-format==21.1.8 |
There was a problem hiding this comment.
As a side note, Zephyr uses latest clang-format which is currently lang-format 22.1.5.
| files=$(git diff --name-only --diff-filter=ACMR "$BASE_SHA" HEAD -- '*.c' '*.h') | ||
| for f in $files; do |
There was a problem hiding this comment.
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: | |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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>
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.
clang-format.ymlworkflow 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.developercertificate.ymlworkflow checks that every non-merge commit in the PR includes a trailingSigned-off-by: name <email>line. If any commit is missing the DCO sign-off, the check fails and blocks merging.