Add check for dist/ directory consistent with source files#766
Merged
Conversation
Collaborator
Author
This issue is ready for review and merge. |
Collaborator
Author
|
After gaining some practical experience with the workflow it should be considered for addition to the status checks in the branch protection rules. |
7a60110 to
de3abf4
Compare
de3abf4 to
7e91966
Compare
jaffrepaul
approved these changes
Feb 10, 2023
jaffrepaul
left a comment
Contributor
There was a problem hiding this comment.
Awesome, glad to see this addition. Should be very useful.
Collaborator
Author
It should definitely catch the error condition if the update commands have not been executed: npm run format
npm run build |
|
🎉 This PR is included in version 5.0.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #706 "Add build & diff "/dist" folder workflow".
It adds a new workflow .github/workflows/check-dist.yml which checks for consistency between source files and the generated contents of the master/dist directory.
If the source files and master/dist are consistent then the workflow succeeds.
If the source files and master/dist are not consistent then the workflow fails.
Verification
Test on Ubuntu 22.04.
Error case
Make a change to master/index.js, for instance, add the following to the top of the source code:
Commit the change
Run the workflow .github/workflows/check-dist.yml
Check that the workflow fails, with the message:
"Detected uncommitted changes after build. See status below:"
Non-error case
Following on from above, execute:
Commit the change and retest.
Check that the workflow now succeeds.
Cross-platform compatibility
After achieving a successful result on Ubuntu 22.04 sync the branch from above onto a Windows 11 platform, then execute:
Confirm that there are no changes whilst ignoring end-of-line changes:
and note the warnings:
Confirm that there are changes:
Commit these changes and retest.
Check that the workflow still succeeds despite having replaced the Ubuntu generated
dist/index.jswith a Windows generated version.