-
-
Save nilium/792103114eef68de3263a0304455f95e to your computer and use it in GitHub Desktop.
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
PKG="go.spiff.io/skim" | |
cd "$WORKSPACE/src/$PKG" | |
# Run tests unmerged | |
if ! GOPATH="$WORKSPACE" go test -cover "$PKG/..."; then | |
exit 1 | |
fi | |
# Re-run tests after merging the branch into master (unless we're already on master) | |
if [ "$(git rev-parse origin/master)" != "$GIT_COMMIT" ]; then | |
echo '# Merging build commits into master for tests' 1>&2 | |
git checkout --detach origin/master | |
if ! git merge --commit --no-edit -m "Merge for ${BUILD_TAG}" "$GIT_COMMIT"; then | |
echo "! Cannot merge branch into master" 1>&2 | |
exit 1 | |
fi | |
GOPATH="$WORKSPACE" go test -cover "$PKG/..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment