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: add a linting step for all of our custom bitbake recipes #114

Closed
wants to merge 1 commit into from
Closed
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
31 changes: 31 additions & 0 deletions .github/workflows/oe-stylize.sh
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}"
18 changes: 18 additions & 0 deletions .github/workflows/oe-stylize.yaml
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
Loading