From 416b4f05f798502292ba858b3de1fddafbbe645d Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 19 Dec 2023 12:08:20 +0100 Subject: [PATCH] multi: update make and CI goals with new packages --- .github/workflows/go.yml | 25 +++++++++++++++++++++++-- .gitignore | 4 +--- Makefile | 17 +++++++++++++---- 3 files changed, 37 insertions(+), 9 deletions(-) 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..7c25970e92 100644 --- a/Makefile +++ b/Makefile @@ -93,9 +93,12 @@ 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.") @@ -103,18 +106,24 @@ 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 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 @@ -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 \