From: Kamalesh Babulal Date: Sat, 5 Aug 2023 07:07:47 +0000 (+0530) Subject: workflows/ci: add checkpatch action X-Git-Tag: v3.2.0~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e07e8326bf110186d56833ed2ad5a63b84ceb679;p=thirdparty%2Flibcgroup.git workflows/ci: add checkpatch action 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 Signed-off-by: Tom Hromatka 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 --- diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 674b900d..3b8dfe6a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -46,6 +46,27 @@ jobs: 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