From 97a5558f83d34c336ac383a846a777c32b8df6da Mon Sep 17 00:00:00 2001
From: Kenny Leung <kleung@chainguard.dev>
Date: Wed, 2 Mar 2022 05:27:49 -0800
Subject: [PATCH] add code coverage to pull request. (#676)

Use codecov as service for code coverage.

Signed-off-by: Kenny Leung <kleung@chainguard.dev>
---
 .github/workflows/main.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e9795f8..d7c66d4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -42,7 +42,9 @@ jobs:
       - name: Fuzz-Build
         run: make -C $GITHUB_WORKSPACE fuzz
       - name: Test
-        run: go test -v ./...
+        run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
+      - name: Upload Coverage Report
+        uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
       - name: Ensure no files were modified as a result of the build
         run: git update-index --refresh && git diff-index --quiet HEAD -- || git diff --exit-code
 
-- 
GitLab