diff --git a/.github/workflows/check_coverage.yml b/.github/workflows/check_coverage.yml new file mode 100644 index 0000000..1690ef6 --- /dev/null +++ b/.github/workflows/check_coverage.yml @@ -0,0 +1,28 @@ +name: Check test coverage + +on: + push: + branches: ["*"] + +jobs: + check-coverage: + name: Check Test Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + - name: check test coverage + uses: vladopajic/go-test-coverage@v2 + with: + profile: cover.out + local-prefix: github.com/lucaschain/beholder + threshold-total: 80 + + git-token: ${{ github.ref_name == 'main' && secrets.GH_TOKEN || '' }} + git-branch: badges diff --git a/README.md b/README.md index 5c89a4b..cb75442 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ![main branch status checks](https://github.com/lucaschain/beholder/actions/workflows/build_and_test.yml/badge.svg) +![coverage](https://raw.githubusercontent.com/org/project/badges/.badges/main/coverage.svg) # Beholder