Skip to content

Workflow file for this run

name: Generate code coverage badge
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Update coverage badge
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action using config file (option 1)
config: ./.testcoverage.yml
# Configure action by specifying input parameters individually (option 2).
# If you are using config file (option 1) you shouldn't use these parameters, however
# specifing these action parameters will override appropriate config values.
profile: cover.out
local-prefix: github.com/conneroisu/seltabl
threshold-file: 80
threshold-package: 80
threshold-total: 95