From a0aa01697cbb99a7caf62e5d1b00325a1b83ae68 Mon Sep 17 00:00:00 2001 From: Eric Warehime Date: Wed, 15 Oct 2025 09:14:36 -0700 Subject: [PATCH] chore: Add Codecov (#25457) --- .github/workflows/test.yml | 8 ++++++ codecov.yml | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 codecov.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58da878c16..692d7c92ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -184,6 +184,14 @@ jobs: with: name: "${{ github.sha }}-e2e-coverage" continue-on-error: true + - name: Upload coverage to Codecov + if: env.GIT_DIFF + uses: codecov/codecov-action@v5 + with: + files: ./00profile.out,./01profile.out,./02profile.out,./03profile.out,./tests/integration-profile.out,./tests/e2e-profile.out + fail_ci_if_error: false + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} test-sim-nondeterminism: runs-on: depot-ubuntu-22.04-4 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..06e8d82bf2 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,53 @@ +# Codecov configuration for cosmos-sdk +# This replaces the previous SonarCloud configuration + +coverage: + precision: 2 + round: down + range: "70...100" + + status: + project: + default: + target: auto + threshold: 0.5% + informational: false + if_ci_failed: error + + patch: + default: + target: auto + threshold: 0.5% + informational: false + if_ci_failed: error + +# Comments on pull requests +comment: + layout: "reach,diff,flags,tree,reach" + behavior: default + require_changes: false + require_base: false + require_head: true + +# Ignore paths - equivalent to old sonar exclusions +ignore: + - "**/*_test.go" # Test files + - "tests/**" # Test directories + - "**/testutil/**" # Test utilities + - "**/*.pb.go" # Protobuf generated files + - "**/*.pb.gw.go" # Protobuf gateway files + - "**/*.pulsar.go" # Pulsar generated files + - "test_helpers.go" # Test helper files + - "docs/**" # Documentation + - "**/*.java" # Java files + - "client/docs/**" # Client documentation + - "**/*.md" # Markdown files + - "**/mock*.go" # Mock files + - "**/*.pb.gateway.go" # Gateway files + +# How to handle multiple coverage reports +# The workflow uploads: 00profile.out, 01profile.out, 02profile.out, 03profile.out, +# integration-profile.out, e2e-profile.out +parsers: + go: + partials_as_hits: true