diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..4b0cd4a4 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,70 @@ +# +# This codecov.yml is the default configuration for +# all repositories on Codecov. You may adjust the settings +# below in your own codecov.yml in your repository. +# +coverage: + precision: 2 + round: down + range: 70...100 + + status: + # Learn more at https://docs.codecov.io/docs/commit-status + project: + default: + threshold: 1% # allow this much decrease on project + app: + target: 70% + flags: + - app + modules: + target: 90% + flags: + - modules + core: + target: 90% + flags: + - core + client: + flags: + - client + changes: false + +comment: + layout: "reach, diff, files" + behavior: default # update if exists else create new + require_changes: true + +flags: + app: + paths: + - "app" + modules: + paths: + - "x" + - "!x/**/client" # ignore client package + core: + paths: + - "core" + - "crypto" + - "types" + clients: + paths: + - "x/**/client" + - "x/**/keeper/grpc_query.go" + +ignore: + - "docs" + - "**/*.md" + - "cmd" + - "client" + - "proto" + - "third_party" + - "testutil" + - "**/test_*.go" + - "**/*.pb.go" + - "**/*.pb.gw.go" + - "x/**/module.go" + - "scripts" + - "ibc/testing" + - "version" \ No newline at end of file diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..ee214cdf --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,42 @@ +name: Tests +on: + pull_request: + push: + branches: + - main + - release/** + tags: + - v* + +jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" + + test-unit-cover: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.20' + check-latest: true + - uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6.1.2 + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - name: Test and Create Coverage Report + run: | + make test-unit-cover + if: env.GIT_DIFF + - uses: codecov/codecov-action@v3 + with: + file: ./coverage.txt + fail_ci_if_error: true + if: env.GIT_DIFF \ No newline at end of file