From a4bb0c078aee9c9206efc3fcdaa6fd97f03a751d Mon Sep 17 00:00:00 2001 From: Shubharanshu Mahapatra Date: Fri, 1 Nov 2024 04:17:13 +0530 Subject: [PATCH] feat: Add code coverage test Signed-off-by: Shubharanshu Mahapatra --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7c0ad70d7..26eb46158 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,7 @@ on: - '.github/workflows/e2e-macos.yaml' - '.github/workflows/e2e-windows.yaml' - '.github/workflows/e2e-linux.yaml' + - '.github/workflows/ci.yaml' - 'contrib/packaging/**' - 'deps/**' - 'finch.yaml.d/**' @@ -27,6 +28,7 @@ on: - '.github/workflows/e2e-macos.yaml' - '.github/workflows/e2e-windows.yaml' - '.github/workflows/e2e-linux.yaml' + - '.github/workflows/ci.yaml' - 'contrib/packaging/**' - 'deps/**' - 'finch.yaml.d/**' @@ -221,7 +223,7 @@ jobs: with: go-version-file: go.mod cache: false - run: | + - run: PKG_COVERAGE=$(paste -sd, test-coverage/macos.txt) go test -cover -coverpkg="${PKG_COVERAGE}" -coverprofile=coverage.out ./... COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')