-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 960 Bytes
/
testcoverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: test coverage
on: [push]
jobs:
testcoverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install nix
uses: nixbuild/nix-quick-install-action@v22
with:
nix_conf: experimental-features = nix-command flakes
- name: Start postgres database
run: |
nix develop --command \
pgnix-init
- name: Run gotests
run: |
nix develop --command \
go test -v ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
local-prefix: github.com/storvik/goshrt
threshold-file: 50
threshold-package: 60
threshold-total: 80
git-token: ${{ github.ref_name == 'master' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges