From a0af20f20ffbb524a37cbef44bf7be04d2563a63 Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Fri, 18 Jul 2025 11:50:57 +0200 Subject: [PATCH] codecov (#418) --- .github/workflows/test.yaml | 16 +++++++++++++++- Makefile | 11 ++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index de4d63c1..e1952545 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -54,7 +54,14 @@ jobs: - name: Run unit tests run: make test-unit - + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./cover.out + flags: unit + tests-e2e: runs-on: ubuntu-latest needs: validate @@ -87,6 +94,13 @@ jobs: - name: Run e2e tests run: make test-e2e + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./cover.out + flags: e2e + - name: Archive k3s logs uses: actions/upload-artifact@v4 if: always() diff --git a/Makefile b/Makefile index f74a1e98..dde544a2 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ VERSION ?= $(shell git describe --tags --always --dirty --match="v[0-9]*") GOLANGCI_LINT_VERSION := v1.64.8 GINKGO_VERSION ?= v2.21.0 +GINKGO_FLAGS ?= -v -r --coverprofile=cover.out --coverpkg=./... ENVTEST_VERSION ?= v0.0.0-20250505003155-b6c5897febe5 ENVTEST_K8S_VERSION := 1.31.0 CRD_REF_DOCS_VER ?= v0.1.0 @@ -51,23 +52,23 @@ push-%: .PHONY: test test: ## Run all the tests - $(GINKGO) -v -r --label-filter=$(label-filter) + $(GINKGO) $(GINKGO_FLAGS) --label-filter=$(label-filter) .PHONY: test-unit test-unit: ## Run the unit tests (skips the e2e) - $(GINKGO) -v -r --skip-file=tests/* + $(GINKGO) $(GINKGO_FLAGS) --skip-file=tests/* .PHONY: test-controller test-controller: ## Run the controller tests (pkg/controller) - $(GINKGO) -v -r pkg/controller + $(GINKGO) $(GINKGO_FLAGS) pkg/controller .PHONY: test-kubelet-controller test-kubelet-controller: ## Run the controller tests (pkg/controller) - $(GINKGO) -v -r k3k-kubelet/controller + $(GINKGO) $(GINKGO_FLAGS) k3k-kubelet/controller .PHONY: test-e2e test-e2e: ## Run the e2e tests - $(GINKGO) -v -r tests + $(GINKGO) $(GINKGO_FLAGS) tests .PHONY: generate generate: ## Generate the CRDs specs