mirror of
https://github.com/status-im/go-waku.git
synced 2025-02-03 01:14:01 +00:00
chore: automate cc-test-reporter install
This commit is contained in:
parent
fd5865b1dc
commit
8af789bb63
3
.gitignore
vendored
3
.gitignore
vendored
@ -34,7 +34,8 @@ go-waku
|
|||||||
*.out.tmp
|
*.out.tmp
|
||||||
coverage.html
|
coverage.html
|
||||||
coverage.json
|
coverage.json
|
||||||
coverage
|
|
||||||
|
cc-test-reporter
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
|
13
Makefile
13
Makefile
@ -18,10 +18,6 @@ endif
|
|||||||
|
|
||||||
ifeq ($(detected_OS),Darwin)
|
ifeq ($(detected_OS),Darwin)
|
||||||
GOBIN_SHARED_LIB_EXT := dylib
|
GOBIN_SHARED_LIB_EXT := dylib
|
||||||
ifeq ("$(shell sysctl -nq hw.optional.arm64)","1")
|
|
||||||
# Building on M1 is still not supported, so in the meantime we crosscompile to amd64
|
|
||||||
GOBIN_SHARED_LIB_CFLAGS=CGO_ENABLED=1 GOOS=darwin GOARCH=amd64
|
|
||||||
endif
|
|
||||||
else ifeq ($(detected_OS),Windows)
|
else ifeq ($(detected_OS),Windows)
|
||||||
# on Windows need `--export-all-symbols` flag else expected symbols will not be found in libgowaku.dll
|
# on Windows need `--export-all-symbols` flag else expected symbols will not be found in libgowaku.dll
|
||||||
GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS="-Wl,--export-all-symbols"
|
GOBIN_SHARED_LIB_CGO_LDFLAGS := CGO_LDFLAGS="-Wl,--export-all-symbols"
|
||||||
@ -76,7 +72,13 @@ test:
|
|||||||
cat ${GO_TEST_OUTFILE}.tmp | grep -v ".pb.go" > ${GO_TEST_OUTFILE}
|
cat ${GO_TEST_OUTFILE}.tmp | grep -v ".pb.go" > ${GO_TEST_OUTFILE}
|
||||||
${GOBIN} tool cover -html=${GO_TEST_OUTFILE} -o ${GO_HTML_COV}
|
${GOBIN} tool cover -html=${GO_TEST_OUTFILE} -o ${GO_HTML_COV}
|
||||||
|
|
||||||
_before-cc:
|
COVERAGE_FILE := ./coverage/cc-test-reporter
|
||||||
|
$(COVERAGE_FILE):
|
||||||
|
curl -sfL https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 --output ./coverage/cc-test-reporter # TODO: support mac and windows
|
||||||
|
chmod +x ./coverage/cc-test-reporter
|
||||||
|
|
||||||
|
_before-cc: $(COVERAGE_FILE)
|
||||||
|
|
||||||
CC_TEST_REPORTER_ID=${CC_TEST_REPORTER_ID} ./coverage/cc-test-reporter before-build
|
CC_TEST_REPORTER_ID=${CC_TEST_REPORTER_ID} ./coverage/cc-test-reporter before-build
|
||||||
|
|
||||||
_after-cc:
|
_after-cc:
|
||||||
@ -87,7 +89,6 @@ test-ci: _before-cc test _after-cc
|
|||||||
generate:
|
generate:
|
||||||
${GOBIN} generate ./...
|
${GOBIN} generate ./...
|
||||||
|
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
${GOBIN} test -count 1 -coverprofile=coverage.out ./...
|
${GOBIN} test -count 1 -coverprofile=coverage.out ./...
|
||||||
${GOBIN} tool cover -html=coverage.out -o=coverage.html
|
${GOBIN} tool cover -html=coverage.out -o=coverage.html
|
||||||
|
0
coverage/.gitkeep
Normal file
0
coverage/.gitkeep
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user