.cirrus: run -race only on non-PR branch
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:
parent
de3c3baf09
commit
147a3ca916
2
Makefile
2
Makefile
|
@ -25,7 +25,7 @@ GO_GCFLAGS := $(shell if $(GO) version|grep -q gccgo; then echo "-gccgoflags"; e
|
||||||
NPROCS := $(shell nproc)
|
NPROCS := $(shell nproc)
|
||||||
export GO_BUILD=$(GO) build
|
export GO_BUILD=$(GO) build
|
||||||
export GO_TEST=$(GO) test -parallel=$(NPROCS)
|
export GO_TEST=$(GO) test -parallel=$(NPROCS)
|
||||||
RACEFLAGS := $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race)
|
RACEFLAGS ?= $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race)
|
||||||
|
|
||||||
COMMIT_NO ?= $(shell git rev-parse HEAD 2> /dev/null || true)
|
COMMIT_NO ?= $(shell git rev-parse HEAD 2> /dev/null || true)
|
||||||
GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
|
GIT_COMMIT ?= $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
|
||||||
|
|
|
@ -67,7 +67,13 @@ else
|
||||||
showrun make validate
|
showrun make validate
|
||||||
;;
|
;;
|
||||||
unit)
|
unit)
|
||||||
showrun make test-unit
|
race=
|
||||||
|
if [[ -z "$CIRRUS_PR" ]]; then
|
||||||
|
# If not running on a PR then run unit tests
|
||||||
|
# with appropriate `-race` flags.
|
||||||
|
race="-race"
|
||||||
|
fi
|
||||||
|
showrun make test-unit RACEFLAGS=$race
|
||||||
;;
|
;;
|
||||||
conformance)
|
conformance)
|
||||||
# Typically it's undesirable to install packages at runtime.
|
# Typically it's undesirable to install packages at runtime.
|
||||||
|
|
Loading…
Reference in New Issue