Skip to content

Commit

Permalink
generate coverage on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim committed Sep 12, 2024
1 parent 6a831eb commit 5523cb0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ jobs:
run: ./test.sh -coverprofile=coverage.out

- name: Upload coverage artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.out

- name: Extract coverage
shell: bash
run: |
COVERAGE=$(go tool cover -func="$OUT_FILE" | tail -1 | grep -Eo '[0-9]+\.[0-9]')
echo "coverage: $COVERAGE% of statements"
coverage-report:
name: Coverage Report
needs: unit-tests
Expand Down

0 comments on commit 5523cb0

Please sign in to comment.