mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 01:01:27 +00:00
Add a new GitHub Actions workflow, checkpatch_pull.yml, which runs checkpatch.pl for each commit in a pull request targeting the master branch. This change ensures proper checkpatch validation for both push and pull request events.
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Checkpatch upon push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
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="${ignore_str// /,}" -
|