Skip to content

test: Add coverage flow #1

test: Add coverage flow

test: Add coverage flow #1

Workflow file for this run

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