Skip to content

Commit

Permalink
Check the git status output is empty in CI to avoid uncommitted build…
Browse files Browse the repository at this point in the history
… artifacts (#61)
  • Loading branch information
moodysalem authored Apr 13, 2020
1 parent 94a16db commit 6f10789
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ jobs:
- run: yarn lint
- run: yarn compile
- run: yarn test
- run: yarn check-compile-output
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"engines": {
"node": ">=10"
},
"dependencies": {
"solc": "0.5.16"
},
"devDependencies": {
"@types/chai": "^4.2.6",
"@types/mocha": "^5.2.7",
Expand All @@ -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 changes: 11 additions & 0 deletions scripts/check-compile-output.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6f10789

Please sign in to comment.