|
From: Gleb C. <lna...@ya...> - 2023-04-05 11:55:30
|
Commit: 0717a72 GitHub URL: https://github.com/SCST-project/scst/commit/0717a72052c63b702fc1d8eca5d1af19e0364410 Author: Gleb Chesnokov Date: 2023-04-05T14:54:49+03:00 Log Message: ----------- github: Add a GitHub action to run checkpatch upon push Introduce a new GitHub action that automatically runs the checkpatch.pl script upon each push to the repository. Modified Paths: -------------- .github/workflows/checkpatch.yml | 42 +++++++++++++++ 1 file changed, 42 insertions(+) =================================================================== diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 0000000..c383886 --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,42 @@ +name: Checkpatch + +on: [push] + +jobs: + checkpatch: + name: ${{matrix.commit.message}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + commit: ${{github.event.commits}} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{matrix.commit.id}} + fetch-depth: 2 + + - name: Download checkpatch.pl + run: | + curl https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl -o checkpatch.pl + curl https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt -o spelling.txt + curl https://raw.githubusercontent.com/torvalds/linux/master/scripts/const_structs.checkpatch -o const_structs.checkpatch + chmod +x checkpatch.pl + + - name: Run checkpatch.pl + run: | + ignore=( + MISSING_SIGN_OFF + EMAIL_SUBJECT + UNKNOWN_COMMIT_ID + NO_AUTHOR_SIGN_OFF + FILE_PATH_CHANGES + SPDX_LICENSE_TAG + LINUX_VERSION_CODE + CONSTANT_COMPARISON + SPACING + ) + ignore_str=${ignore[*]} + + git format-patch -1 --stdout | ./checkpatch.pl --no-tree --show-types --ignore=$(echo "${ignore_str// /,}") - |