diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c1625428d3..29e32008f2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -45,6 +45,13 @@ 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: @@ -52,6 +59,20 @@ jobs: 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: @@ -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 diff --git a/.gitignore b/.gitignore index 5c29ccd9b5..38e857ac68 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index 5bfb1aa6a5..c2d80c3978 100644 --- a/Makefile +++ b/Makefile @@ -93,9 +93,14 @@ 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.") @@ -103,18 +108,26 @@ unit-cover: $(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 @@ -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 \