Merge pull request #477 from uselagoon/refactor-mocks #190
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coverage | |
on: | |
push: | |
branches: | |
- main | |
permissions: {} | |
jobs: | |
coverage: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version: stable | |
- name: Calculate coverage | |
run: | | |
go test -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./... | |
- name: Generage coverage badge | |
uses: vladopajic/go-test-coverage@c7fe52e0f48e0fbed8c1812824c5346218443c70 # v2.10.2 | |
with: | |
profile: cover.out | |
local-prefix: github.com/${{ github.repository }} | |
git-token: ${{ secrets.GITHUB_TOKEN }} | |
# orphan branch for storing badges | |
git-branch: badges |