From bff36180e01057356e844bd40d72a88d52eee993 Mon Sep 17 00:00:00 2001 From: umang01-hash Date: Wed, 8 Jan 2025 11:20:25 +0530 Subject: [PATCH] test warning count step --- .github/workflows/go.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f3346fd98..9269bf504 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -118,6 +118,20 @@ jobs: grep -v '/mock_' package.cov > profile.cov go tool cover -func profile.cov + - name: Count Warnings + id: count-warnings + run: | + warning_count=$(go test gofr.dev/pkg/... -v | grep -c "WARNING") + echo "Warnings found: $warning_count" + echo "warning_count=$warning_count" >> $GITHUB_ENV + + - name: Fail if too many warnings + run: | + if [ ${{ env.warning_count }} -gt 10 ]; then + echo "Too many warnings: ${{ env.warning_count }}" + exit 1 + fi + - name: Upload Test Coverage if: ${{ matrix.go-version == '1.22'}} uses: actions/upload-artifact@v4