Skip to content

Commit

Permalink
add coverage flow
Browse files Browse the repository at this point in the history
  • Loading branch information
anhductn2001 committed Nov 4, 2024
1 parent a8ff6c1 commit d141af3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code Coverage

on:
pull_request:

jobs:
test-and-coverage:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: Install dependencies
run: go mod download

- name: Run tests with coverage
run: |
mkdir -p coverage
go test -v -coverpkg=./... -coverprofile=coverage/coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage.out
flags: cosmos
fail_ci_if_error: true

0 comments on commit d141af3

Please sign in to comment.