-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: add a linting step for all of our custom bitbake recipes
Signed-off-by: Leonard Göhrs <[email protected]>
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e -u -o pipefail | ||
|
||
FILES="$(find meta-lxatac-bsp/ meta-lxatac-software/ -type f -name \*.bb)" | ||
|
||
result="0" | ||
|
||
while read -r recipe | ||
do | ||
# The oe-stylize script is not parameterizable, so we can not tell it not | ||
# to output warnings about variables it does not know. | ||
# Use grep to remove the warnings from its output. | ||
python3 meta-oe/contrib/oe-stylize.py "${recipe}" | \ | ||
grep -v "## Warning: unknown variable/routine" > "${recipe}.linted" | ||
|
||
diff --color=always "${recipe}" "${recipe}.linted" > "${recipe}.diff" \ | ||
&& file_result="ok" || file_result="error" | ||
|
||
if [[ "x${file_result}" != "xok" ]] | ||
then | ||
# Group the output in the GitHub log as it can become quite unwieldy | ||
echo "::group::${recipe}" | ||
cat "${recipe}.diff" | ||
echo "::endgroup::" | ||
|
||
result="1" | ||
fi | ||
done <<< "${FILES}" | ||
|
||
exit "${result}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: oe-stylize | ||
|
||
on: | ||
create: # tags and branches | ||
pull_request: | ||
push: | ||
jobs: | ||
check: | ||
name: lint recipes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Run oe-stylize for all recipes | ||
run: .github/workflows/oe-stylize.sh |