diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f869ba3..42f14ad 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,10 +1,6 @@ name: Go -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push] jobs: @@ -22,4 +18,9 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v -coverprofile=profile.cov ./... + + - name: Send coverage + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: profile.cov \ No newline at end of file diff --git a/README.md b/README.md index 45ee982..5b930f1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,10 @@ A lightweight IoC dependency injection container for Golang [![Build status](https://github.com/studyzy/iocgo/workflows/Go/badge.svg)](https://github.com/studyzy/iocgo/actions) +[![Coverage Status](https://coveralls.io/repos/github/studyzy/iocgo/badge.svg)](https://coveralls.io/github/studyzy/iocgo) + English | [中文](https://github.com/studyzy/iocgo/blob/main/README-zh_CN.md) + # How to use ## Installation it requires Go 1.15 or newer versions.