diff --git a/templates/.github/workflows/go-test.yml b/templates/.github/workflows/go-test.yml index ceca1cb5..9270db70 100644 --- a/templates/.github/workflows/go-test.yml +++ b/templates/.github/workflows/go-test.yml @@ -29,7 +29,10 @@ jobs: - name: Run tests uses: protocol/multiple-go-modules@v1.2 with: - run: go test -v -coverprofile module-coverage.txt ./... + # Use -coverpkg=./..., so that we include cross-package coverage. + # If package ./A imports ./B, and ./A's tests also cover ./B, + # this means ./B's coverage will be significantly higher than 0%. + run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./... - name: Run tests (32 bit) if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. uses: protocol/multiple-go-modules@v1.2