Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix checkpatch #497

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ jobs:
name: checkpatch review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout the code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Install python dependencies
run: |
pip3 install setuptools
pip3 install junitparser==1.6.3 gitlint codespell
pip3 install python-magic junitparser gitlint codespell lxml
- name: Run Compliance Tests
continue-on-error: true
id: compliance
Expand All @@ -32,7 +36,8 @@ jobs:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git rebase origin/${BASE_REF}
./scripts/ci/check_compliance.py -m checkpatch -m Gitlint -m Identity -c origin/${BASE_REF}..
git log --pretty=oneline | head -n 10
./scripts/ci/check_compliance.py --annotate -c origin/${BASE_REF}..

- name: upload-results
uses: actions/upload-artifact@main
Expand All @@ -47,13 +52,15 @@ jobs:
exit 1;
fi

for file in checkpatch.txt Identity.txt Gitlint.txt; do
if [[ -s $file ]]; then
errors=$(cat $file)
files=($(./scripts/ci/check_compliance.py -l))
for file in "${files[@]}"; do
f="${file}.txt"
if [[ -s $f ]]; then
errors=$(cat $f)
errors="${errors//'%'/'%25'}"
errors="${errors//$'\n'/'%0A'}"
errors="${errors//$'\r'/'%0D'}"
echo "::error file=${file}::$errors"
echo "::error file=${f}::$errors"
exit=1
fi
done
Expand Down
Loading