ci: rename actions file and fix cover badge creation #1
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: test | |
on: [push] | |
permissions: | |
contents: write | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: run tests | |
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... | |
- name: generate coverage badge | |
uses: vladopajic/go-test-coverage@v2 | |
with: | |
profile: cover.out | |
local-prefix: github.com/gkits/sqlnull | |
threshold-total: 95 | |
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} | |
git-branch: badges |