From f5305cea0432e651a4d785db82cb9541cc900d88 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 18 Dec 2024 17:56:12 +0100 Subject: [PATCH] gha: add codecov Signed-off-by: Sebastiaan van Stijn --- .github/codecov.yml | 15 +++++++++++++++ .github/workflows/test.yml | 4 ++++ .gitignore | 1 + Makefile | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..3a0035f1 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,15 @@ +comment: false + +github_checks: + annotations: false + +coverage: + status: + patch: false + # project will give us the diff in the total code coverage between a commit + # and its parent + project: + default: + target: auto + threshold: "15%" + changes: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50e4ae70..3fa92833 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,10 @@ jobs: run: | uname -a make test + - name: Send to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533 codespell: runs-on: ubuntu-24.04 diff --git a/.gitignore b/.gitignore index 58ef1e49..573b0a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /_build/ /mount/go-local.* +coverage.txt diff --git a/Makefile b/Makefile index 22ad5d91..bc0c1246 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ all: clean lint test cross .PHONY: clean clean: $(RM) mount/go-local.* + $(RM) */coverage.txt .PHONY: foreach foreach: ## Run $(CMD) for every package. @@ -25,7 +26,7 @@ foreach: ## Run $(CMD) for every package. .PHONY: test test: test-local -test: CMD=go test $(RUN_VIA_SUDO) -v . +test: CMD=go test $(RUN_VIA_SUDO) -v -coverprofile=coverage.txt -covermode=atomic . test: foreach # Test the mount module against the local mountinfo source code instead of the