summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml15
1 files changed, 13 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 36b383e..8fd0031 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,8 +18,19 @@ jobs:
with:
go-version: '1.22'
- - name: Run tests
- run: go test ./...
+ - name: Run tests with coverage
+ run: |
+ go test -coverprofile=coverage.out ./...
+ if [ "$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%')" -lt 60 ]; then
+ echo "Coverage below 60%"
+ exit 1
+ fi
+
+ - name: Upload coverage to GitHub
+ uses: actions/upload-artifact@v4
+ with:
+ name: coverage-report
+ path: coverage.out
lint:
runs-on: ubuntu-latest