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 d97d6a4 commit 09aab7d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 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
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,41 @@ 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 btcutil; $(GOTEST_DEV) ./... -test.timeout=20m
cd btcutil/psbt; $(GOTEST_DEV) ./... -test.timeout=20m
cd chaincfg; $(GOTEST_DEV) ./... -test.timeout=20m
cd chainhash; $(GOTEST_DEV) ./... -test.timeout=20m
cd txscript; $(GOTEST_DEV) ./... -test.timeout=20m
cd psbt; $(GOTEST_DEV) ./... -test.timeout=20m
cd wire; $(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 btcutil; $(GOACC_BIN) ./...

cd btcutil/psbt; $(GOACC_BIN) ./...
cd btcutil; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd chaincfg; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd chainhash; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd txscript; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd psbt; $(GOACC_BIN) ./...; sed -i.bak 's/v2\///g' coverage.txt
cd wire; $(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 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 chaincfg; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd chainhash; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...
cd txscript; 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 ./...
cd wire; env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m ./...

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

clean:
@$(call print, "Cleaning source.$(NC)")
$(RM) coverage.txt btcec/coverage.txt btcutil/coverage.txt btcutil/psbt/coverage.txt
find . -name coverage.txt | xargs echo
find . -name coverage.txt.bak | xargs echo

.PHONY: all \
default \
Expand Down

0 comments on commit 09aab7d

Please sign in to comment.