Skip to content

Merge pull request #25 from smlx/readme-alerts #2

Merge pull request #25 from smlx/readme-alerts

Merge pull request #25 from smlx/readme-alerts #2

Workflow file for this run

name: coverage
on:
push:
branches:
- main
permissions: {}
jobs:
coverage:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: stable
- name: Calculate coverage
run: |
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
# remove mocks from coverage calculation
grep -Ev 'mock_|_enumer.go' cover.out.raw > cover.out
- name: Generage coverage badge
uses: vladopajic/go-test-coverage@bcd064e5ceef1ccec5441519eb054263b6a44787 # v2.8.2
with:
profile: cover.out
local-prefix: github.com/smlx/goodwe-exporters
git-token: ${{ secrets.GITHUB_TOKEN }}
# orphan branch for storing badges
git-branch: badges