Add checkpatch action from https://github.com/webispy/checkpatch-action
to workflow CI, this project uses the Linux kernel tree's checkpatch.pl
to review the Pull Request, C code changes for the coding style issues.
We try to follow the coding standards that of the Linux Kernel, with some
exceptions recorded in the .checkpatch.conf file, asking checkpatch.pl
to ignore those. Integrating this action will make every change
complaint with Linux Kernel coding standards. As per their GitHub page
[1] the project uses GPL-2.0 license.
[1] https://github.com/webispy/checkpatch-action#license
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Since the action requires info embedded in the Github pull request,
only run it on pull requests. Don't run it on pushes as it will
produce a false positive
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
+ checkpatch:
+ name: Checkpatch Review
+ runs-on: ubuntu-latest
+ if: github.event_name == 'pull_request'
+
+ permissions:
+ contents: read
+ pull-requests: read
+
+ steps:
+ - name: 'Calculate PR commits + 1'
+ run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: ${{ env.PR_FETCH_DEPTH }}
+ - name: Run checkpatch review
+ uses: webispy/checkpatch-action@v9
+ env:
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+
doxygen:
name: Doxygen
# Only run Doxygen against the main branch