-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gate execution of expensive tests on JS being up to date
- Loading branch information
Robin Neatherway
committed
Dec 8, 2020
1 parent
8cbc02a
commit 3e176f8
Showing
4 changed files
with
81 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Sanity check that repo is clean to start with | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
# If we get a fail here then this workflow needs attention... | ||
>&2 echo "Failed: Repo should be clean before testing!" | ||
exit 1 | ||
fi | ||
# Wipe the lib directory incase there are extra unnecessary files in there | ||
rm -rf lib | ||
# Generate the JavaScript files | ||
npm run-script build | ||
# Check that repo is still clean | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
# If we get a fail here then the PR needs attention | ||
>&2 echo "Failed: JavaScript files are not up to date. Run 'npm run-script build' to update" | ||
git status | ||
exit 1 | ||
fi | ||
echo "Success: JavaScript files are up to date" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Sanity check that repo is clean to start with | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
# If we get a fail here then this workflow needs attention... | ||
>&2 echo "Failed: Repo should be clean before testing!" | ||
exit 1 | ||
fi | ||
# Reinstall modules and then clean to remove absolute paths | ||
# Use 'npm ci' instead of 'npm install' as this is intended to be reproducible | ||
npm ci | ||
npm run removeNPMAbsolutePaths | ||
# Check that repo is still clean | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
# If we get a fail here then the PR needs attention | ||
>&2 echo "Failed: node_modules are not up to date. Run 'npm ci' and 'npm run removeNPMAbsolutePaths' to update" | ||
git status | ||
exit 1 | ||
fi | ||
echo "Success: node_modules are up to date" |