diff --git a/.github/workflows/test_template.yml b/.github/workflows/test_template.yml index 38fa10e096b..f7d001dcac5 100644 --- a/.github/workflows/test_template.yml +++ b/.github/workflows/test_template.yml @@ -36,13 +36,17 @@ jobs: mkdir -p "$GOCOVERDIR" "$TXTARCOVERDIR" "$COVERDIR" # Craft a filter flag based on the module path to avoid expanding coverage on unrelated tags. - export filter="-pkg=github.com/gnolang/gno/${{ inputs.modulepath }}/..." + export coverpkg="github.com/gnolang/gno/${{ inputs.modulepath }}/..." + export filter="-pkg=$coverpkg" # XXX: Simplify coverage of txtar - the current setup is a bit # confusing and meticulous. There will be some improvements in Go # 1.23 regarding coverage, so we can use this as a workaround until # then. - go test -covermode=atomic -timeout ${{ inputs.tests-timeout }} ./... -test.gocoverdir=$GOCOVERDIR + go test -coverpkg=$coverpkg \ + -covermode=atomic \ + -timeout ${{ inputs.tests-timeout }} \ + ./... $coverpkg -test.gocoverdir=$GOCOVERDIR # Print results (set +x; echo 'go coverage results:')