Skip to content

Commit

Permalink
add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
jiujiteiro committed Mar 29, 2023
1 parent 3b59afe commit 19f4c9b
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 42 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit 19f4c9b

Please sign in to comment.