From b6d9ca9ffa129df18f92dbd08d648f200e587286 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Tue, 4 Feb 2025 18:09:54 -0800 Subject: [PATCH] Add code coverage GH action --- .github/workflows/build.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72b0230..8cfcc5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,20 @@ jobs: filters: | golang: - '**.go' + code-coverage: + name: Check code coverage + if: needs.changes.outputs.golang == 'true' + needs: changes + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 + - uses: gwatts/go-coverage-action@2845595538a59d63d1bf55f109c14e104c6f7cb3 # 2.0.0 + with: + coverage-threshold: 40 unit-test: name: Check Go lang unit tests if: needs.changes.outputs.golang == 'true' @@ -77,7 +91,7 @@ jobs: contents: read attestations: write id-token: write - needs: unit-test + needs: [code-coverage, unit-test] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 - name: Log in to the Container registry