Add check for dist/ directory consistent with source files #766
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.js
with a Windows generated version.