Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci(component): Check if examples declared and folders match #12151

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

Open
lucasssvaz wants to merge 1 commit into espressif:master
base: master
Choose a base branch
Loading
from lucasssvaz:ci/idf_examples_check
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/build_component.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,42 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: bash ./.github/scripts/check-cmakelists.sh

check-examples:
name: Check Examples Match
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'release/')) }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Check examples consistency
run: |
# Get list of folders in idf_component_examples (excluding hidden files)
actual_examples=$(find idf_component_examples -maxdepth 1 -type d ! -path idf_component_examples | sed 's|idf_component_examples/||' | sort)

# Extract example paths from idf_component.yml
declared_examples=$(grep -A 100 "^examples:" idf_component.yml | grep "path:" | sed 's/.*path: *\.\/idf_component_examples\///' | sort)

echo "=== Examples in idf_component_examples folder ==="
echo "$actual_examples"
echo ""
echo "=== Examples declared in idf_component.yml ==="
echo "$declared_examples"
echo ""

# Compare the two lists
if [ "$actual_examples" != "$declared_examples" ]; then
echo "❌ ERROR: Examples mismatch detected!"
echo ""
echo "Examples in folder but NOT in idf_component.yml:"
comm -23 <(echo "$actual_examples") <(echo "$declared_examples") | sed 's/^/ - /'
echo ""
echo "Examples in idf_component.yml but NOT in folder:"
comm -13 <(echo "$actual_examples") <(echo "$declared_examples") | sed 's/^/ - /'
exit 1
else
echo "✅ All examples match correctly!"
fi

set-matrix:
name: Set Matrix
runs-on: ubuntu-latest
Expand Down

AltStyle によって変換されたページ (->オリジナル) /