From c4e35960b91852e9b06024a4fee59c7978cfdc75 Mon Sep 17 00:00:00 2001 From: xray33 Date: Sun, 11 Oct 2026 18:10:44 +0300 Subject: [PATCH] ci: enable cross-package coverage and configure Codecov ignore paths --- .codecov.yml | 27 +++++++++++++++++++++++++++ .github/workflows/ci.yml | 2 +- Makefile | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..f4d1c7a --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,27 @@ +# Codecov configuration +# Reference: https://docs.codecov.com/docs/codecov-yaml + +coverage: + precision: 1 + round: down + range: "50...90" + status: + project: + default: + target: auto + threshold: 2% + patch: + default: + target: auto + threshold: 2% + +comment: + layout: "reach,diff,flags,files,footer" + behavior: default + require_changes: false + +ignore: + - "cmd/**/*" # CLI entry points (serve, migrate, user, reindex CLI flags) + - "deploy/**/*" # Ansible deployment playbooks & templates + - "web/**/*" # React frontend (tested independently) + - "test/**/*" # Integration test helpers diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecc0051..6bc1a78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: env: DB_DSN: "selfcloud:selfcloud_pass@tcp(127.0.0.1:3306)/selfcloud?parseTime=true" run: | - go test -v -race -coverprofile=coverage.out ./... + go test -v -race -coverpkg=./internal/... -coverprofile=coverage.out ./... - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 diff --git a/Makefile b/Makefile index b5f1ccd..7b78920 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ test: $(ENV_PATH) go test -v ./... test-coverage: - $(ENV_PATH) go test -coverprofile=coverage.out ./... + $(ENV_PATH) go test -coverpkg=./internal/... -coverprofile=coverage.out ./... $(ENV_PATH) go tool cover -html=coverage.out -o coverage.html @echo "Coverage report: coverage.html" @open coverage.html