mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Fix the following warning: Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. Signed-off-by: Bart Van Assche <bvanassche@acm.org>
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
name: Checkpatch upon pull
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
checkpatch:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@main
|
|
with:
|
|
ref: ${{github.event.pull_request.head.sha}}
|
|
fetch-depth: 0
|
|
|
|
- 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
|
|
COMMIT_LOG_USE_LINK
|
|
BAD_REPORTED_BY_LINK
|
|
FILE_PATH_CHANGES
|
|
SPDX_LICENSE_TAG
|
|
LINUX_VERSION_CODE
|
|
CONSTANT_COMPARISON
|
|
NEW_TYPEDEFS
|
|
SPACING
|
|
)
|
|
ignore_str=${ignore[*]}
|
|
|
|
base_commit=${{github.event.pull_request.base.sha}}
|
|
commits=$(git log --pretty=format:"%h" $base_commit..HEAD)
|
|
err=0
|
|
|
|
for commit in $commits; do
|
|
echo "Running checkpatch.pl for commit $commit"
|
|
echo "========================================"
|
|
git format-patch -1 --stdout $commit | ./checkpatch.pl --no-tree --show-types --ignore="${ignore_str// /,}" - || err=1
|
|
echo
|
|
done
|
|
|
|
exit $err
|