Skip to content

Commit

Permalink
multi: update make and CI goals with new packages
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed Dec 19, 2023
1 parent 7f1ab4d commit 416b4f0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,34 @@ jobs:
flag-name: btcd
parallel: true

- name: Send address
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: address/coverage.txt
flag-name: address
parallel: true

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

- name: Send chaincfg
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: chaincfg/coverage.txt
flag-name: chaincfg
parallel: true

- name: Send chaincfg coverage for chainhash package
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: chaincfg/chainhash/coverage.txt
flag-name: chaincfgchainhash
parallel: true

- name: Send btcutil coverage
uses: shogo82148/actions-goveralls@v1
with:
Expand All @@ -62,8 +83,8 @@ jobs:
- name: Send btcutil coverage for psbt package
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: btcutil/psbt/coverage.txt
flag-name: btcutilpsbt
path-to-profile: psbt/coverage.txt
flag-name: psbt
parallel: true

- name: Notify coveralls all reports sent
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ _testmain.go
profile.tmp
profile.cov
coverage.txt
btcec/coverage.txt
btcutil/coverage.txt
btcutil/psbt/coverage.txt
coverage.txt.bak

# vim
*.swp
Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,37 @@ check: unit
unit:
@$(call print, "Running unit tests.")
$(GOTEST_DEV) ./... -test.timeout=20m
cd address; $(GOTEST_DEV) ./... -test.timeout=20m
cd btcec; $(GOTEST_DEV) ./... -test.timeout=20m
cd chaincfg; $(GOTEST_DEV) ./... -test.timeout=20m
cd chaincfg/chainhash; $(GOTEST_DEV) ./... -test.timeout=20m
cd btcutil; $(GOTEST_DEV) ./... -test.timeout=20m
cd btcutil/psbt; $(GOTEST_DEV) ./... -test.timeout=20m
cd psbt; $(GOTEST_DEV) ./... -test.timeout=20m

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

# We need to remove the /v2 pathing from the module to have it work
# nicely with the CI tool we use to render live code coverage.
cd address; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd btcec; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt

cd chaincfg; $(GOACC_BIN) ./...
cd chaincfg/chainhash; $(GOACC_BIN) ./...
cd btcutil; $(GOACC_BIN) ./...

cd btcutil/psbt; $(GOACC_BIN) ./...
cd psbt; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt

unit-race:
@$(call print, "Running unit race tests.")
env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd address; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd btcec; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd chaincfg; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd chaincfg/chainhash; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd btcutil; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd btcutil/psbt; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd psbt; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...

# =========
# UTILITIES
Expand All @@ -132,7 +141,7 @@ lint: $(LINT_BIN)

clean:
@$(call print, "Cleaning source.$(NC)")
$(RM) coverage.txt btcec/coverage.txt btcutil/coverage.txt btcutil/psbt/coverage.txt
$(RM) coverage.txt address/coverage.txt btcec/coverage.txt chaincfg/coverage.txt chaincfg/chainhash/coverage.txt btcutil/coverage.txt psbt/coverage.txt

.PHONY: all \
default \
Expand Down

0 comments on commit 416b4f0

Please sign in to comment.