Skip to content

Commit

Permalink
ci: add action for unittesting and creating cover badge
Browse files Browse the repository at this point in the history
  • Loading branch information
gKits committed Oct 23, 2024
1 parent 09a7ea7 commit 142e6f7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unittest

on: [push]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3

- name: Run unittests
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...

- name: Generate cover badge
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
locale-prefix: github.com/gkits/sqlnull
threshold-total: 95
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges

0 comments on commit 142e6f7

Please sign in to comment.