From 286902375f94a1adb64878b9efddf06ffc0d3ac1 Mon Sep 17 00:00:00 2001 From: Philip Hughes Date: Fri, 6 Dec 2024 09:49:10 -0500 Subject: [PATCH] make coverage ignore list easier to manage as a list; target codegen/testserver gen files more closely --- .github/workflows/check-coverage | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-coverage b/.github/workflows/check-coverage index 9244270d60..896828fb17 100755 --- a/.github/workflows/check-coverage +++ b/.github/workflows/check-coverage @@ -7,4 +7,28 @@ go test -covermode atomic -coverprofile=/tmp/coverage.out.tmp -coverpkg=./... $( # ignore protobuf files cat /tmp/coverage.out.tmp | grep -v ".pb.go" > /tmp/coverage.out -goveralls -coverprofile=/tmp/coverage.out -service=github -ignore='_examples/*/*,_examples/*/*/*,integration/*,integration/*/*,codegen/testserver/*/*,plugin/resolvergen/testdata/*/*,plugin/modelgen/*/*,plugin/federation/testdata/*/*/*,*/generated.go,*/*/generated.go,*/*/*/generated.go,graphql/executable_schema_mock.go' +join () { + local IFS="$1" + shift + echo "$*" +} + +ignore_list=( + '_examples/*/*' + '_examples/*/*/*' + 'integration/*' + 'integration/*/*' + 'codegen/testserver/**/*generated*' + 'codegen/testserver/**/models-gen.go' + 'codegen/testserver/**/resolver.go' + 'plugin/resolvergen/testdata/*/*' + 'plugin/modelgen/*/*' + 'plugin/federation/testdata/*/*/*' + '*/generated.go' + '*/*/generated.go' + '*/*/*/generated.go' + 'graphql/executable_schema_mock.go' +) +ignore=$(join , "${ignore_list[@]}") + +goveralls -coverprofile=/tmp/coverage.out -service=github "-ignore=$ignore"