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

Github workflow to check if examples build #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

egisz
Copy link

@egisz egisz commented Nov 9, 2023

Automated test to check if example configurations builds successfully. Credits to this nice article.
Uses esphome build action
This makes life easier for repo owner when someone creates pull request (like me :) )
Check mark besides commit hash indicates it's successful.
image
All action runs are available in Actions menu.
image

Copy link
Owner

@elupus elupus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! I like it. Some notes.

- name: "Patch config to test local component"
run: |
echo "Replace !secrets to some dummy string"
sed -i 's/!secret.*/Dummy123/g' ${{matrix.target}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to create a secrets file.

Also i think we should make a copy of the config and edit that file? I sort of dislike editing checked in files even if it's temporary.

sed -i 's/url: https:\/\/github.*/path: ..\/components/g' ${{matrix.target}}
sed -i 's/source: github.*/source: ..\/components/g' ${{matrix.target}}
echo "Remove encryption key"
sed -i '/encryption:/,+2d' ${{matrix.target}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

- id: dataStep
run: |
TARGETS=$(ls examples/*.yaml | jq -R -s -c 'split("\n")[:-1]')
echo "myoutput=$(jq -cn --argjson environments $TARGETS '{target: $environments}')" >> $GITHUB_OUTPUT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants