1
0
Fork 0
mirror of https://github.com/Luzifer/github-publish.git synced 2024-12-20 09:51:22 +00:00

Allow to disable tests

which might be required to build for example WASM projects

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-06-13 16:27:01 +02:00
parent 33d3eb8ed3
commit 2b13050ea0
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 11 additions and 8 deletions

View file

@ -1,2 +1,2 @@
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
fcf00a177d53ec3b60d20e99849727dcf66136902e776cdde6c6c4a72cea81f5 golang.sh
b93ca8d05cc16d59d5ae117cbb389a82e505bb1f1b46f454ae8aac73bd4ffade golang.sh

View file

@ -29,6 +29,7 @@ BUILD_DIR=${BUILD_DIR:-.build}
DRAFT=${DRAFT:-true}
FORCE_SKIP_UPLOAD=${FORCE_SKIP_UPLOAD:-false}
MOD_MODE=${MOD_MODE:-}
NO_TESTS=${NO_TESTS:-false}
go version
@ -38,16 +39,18 @@ pushd "${GOPATH}/src/github.com/Luzifer/github-release"
GO111MODULE=on go install
popd
step "Test code"
go_params=()
if [[ $NO_TESTS == false ]]; then
step "Test code"
go_params=()
if [[ -n ${MOD_MODE} ]]; then
go_params+=(-mod="${MOD_MODE}")
if [[ -n ${MOD_MODE} ]]; then
go_params+=(-mod="${MOD_MODE}")
fi
go vet "${go_params[@]}" ${PACKAGES}
go test "${go_params[@]}" ${PACKAGES}
fi
go vet "${go_params[@]}" ${PACKAGES}
go test "${go_params[@]}" ${PACKAGES}
step "Cleanup build directory if present"
rm -rf ${BUILD_DIR}