Skip to content

Run testcoverage in its own action #1

Run testcoverage in its own action

Run testcoverage in its own action #1

Workflow file for this run

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