Skip to content

chore: cleanup and lint fixes #5

chore: cleanup and lint fixes

chore: cleanup and lint fixes #5

Workflow file for this run

on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.21
cache: false
- uses: golangci/golangci-lint-action@v3
with:
version: v1.55
- run: go test -v ./...
- run: go test ./... -coverprofile=coverage.out
- run: go tool cover -func=coverage.out
- name: Coverage Quality Check
env:
REQUIRED_COVERAGE: 80
run: |
totalCoverage=$(go tool cover -func=cover.out | grep total | grep -Eo '[0-9]+\.[0-9]+')
echo "Total Coverage: $totalCoverage %"
if (( $totalCoverage < $REQUIRED_COVERAGE )); then
echo "Coverage is less than $REQUIRED_COVERAGE %"
exit 1
fi