Skip to content

Commit

Permalink
build: replace goacc with go test for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Dec 18, 2024
1 parent d8e1d3b commit 6b26311
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,15 @@ jobs:
- name: Test
run: make unit-cover

- name: Send top-level coverage
uses: shogo82148/actions-goveralls@v1
- name: Send coverage
uses: coverallsapp/github-action@v2
with:
path-to-profile: coverage.txt

- name: Send btcec
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: btcec/coverage.txt

- name: Send btcutil coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: btcutil/coverage.txt

- name: Send btcutil coverage for psbt package
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: btcutil/psbt/coverage.txt
files: |
coverage.txt
path-to-profile: btcec/coverage.txt
btcutil/coverage.txt
btcutil/psbt/coverage.txt
format: golang

test-race:
name: Unit race
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GOIMPORTS_PKG := golang.org/x/tools/cmd/goimports

GO_BIN := ${GOPATH}/bin
LINT_BIN := $(GO_BIN)/golangci-lint
GOACC_BIN := $(GO_BIN)/go-acc


LINT_COMMIT := v1.18.0
GOACC_VERSION := v0.2.7
Expand All @@ -15,9 +15,11 @@ DEPGET := cd /tmp && GO111MODULE=on go get -v
GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -v
DEV_TAGS := rpctest
GOTEST_DEV = GO111MODULE=on go test -v -tags=$(DEV_TAGS)
GOTEST_DEV = GO111MODULE=on go test -tags=$(DEV_TAGS)
GOTEST := GO111MODULE=on go test -v

GOACC_BIN := $(GOTEST_DEV) -coverprofile=coverage.txt -covermode=atomic

GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")

RM := rm -f
Expand Down Expand Up @@ -51,10 +53,6 @@ $(LINT_BIN):
@$(call print, "Fetching linter")
$(DEPGET) $(LINT_PKG)@$(LINT_COMMIT)

$(GOACC_BIN):
@$(call print, "Fetching go-acc")
$(GOINSTALL) $(GOACC_PKG)@$(GOACC_VERSION)

goimports:
@$(call print, "Installing goimports.")
$(DEPGET) $(GOIMPORTS_PKG)
Expand Down Expand Up @@ -84,7 +82,7 @@ unit:
cd btcutil; $(GOTEST_DEV) ./... -test.timeout=20m
cd btcutil/psbt; $(GOTEST_DEV) ./... -test.timeout=20m

unit-cover: $(GOACC_BIN)
unit-cover:
@$(call print, "Running unit coverage tests.")
$(GOACC_BIN) ./...

Expand Down

0 comments on commit 6b26311

Please sign in to comment.