Check the git status output is empty in CI to avoid uncommitted build artifacts (#61)

This commit is contained in:
Moody Salem
2020-04-13 15:44:42 -04:00
committed by GitHub
parent 94a16db6dd
commit 6f10789f92
3 changed files with 20 additions and 6 deletions

View File

@ -37,3 +37,4 @@ jobs:
- run: yarn lint
- run: yarn compile
- run: yarn test
- run: yarn check-compile-output

View File

@ -2,9 +2,6 @@
"engines": {
"node": ">=10"
},
"dependencies": {
"solc": "0.5.16"
},
"devDependencies": {
"@types/chai": "^4.2.6",
"@types/mocha": "^5.2.7",
@ -14,13 +11,18 @@
"mocha": "^6.2.2",
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"solc": "0.5.16",
"ts-node": "^8.5.4",
"typescript": "^3.7.3"
},
"scripts": {
"lint": "yarn prettier ./test/*.ts --check",
"compile": "rimraf ./build/ && waffle .waffle.json",
"test": "mocha"
"clean": "rimraf ./build/",
"precompile": "yarn clean",
"compile": "waffle .waffle.json",
"pretest": "yarn compile",
"test": "mocha",
"check-compile-output": "./scripts/check-compile-output.sh"
},
"license": "GPL-3.0-or-later"
}
}

11
scripts/check-compile-output.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# Checks that there are no uncommitted files in the repo.
if [[ -z $(git status -s) ]]
then
exit 0
else
echo "There are uncommitted file changes!"
echo "The committed build artifacts likely do not match the source code."
exit 1
fi