-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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}} |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this somewhat hard tro grasp: this looks a bit cleaner: https://code.dblock.org/2021/09/03/generating-task-matrix-by-looping-over-repo-files-with-github-actions.html
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.
All action runs are available in Actions menu.