diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0c4df8..4cb6f16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,14 @@ jobs: - name: Display coverage report run: go tool cover -func=coverage.out + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.out + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + - name: Install Vue dependencies run: make vue-install diff --git a/README.md b/README.md index 78eaacd..cce5824 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # SRS-SIP +[![CI](https://github.com/ossrs/srs-sip/actions/workflows/ci.yml/badge.svg)](https://github.com/ossrs/srs-sip/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/ossrs/srs-sip/branch/main/graph/badge.svg)](https://codecov.io/gh/ossrs/srs-sip) +[![Go Report Card](https://goreportcard.com/badge/github.com/ossrs/srs-sip)](https://goreportcard.com/report/github.com/ossrs/srs-sip) +[![License](https://img.shields.io/github/license/ossrs/srs-sip)](https://github.com/ossrs/srs-sip/blob/main/LICENSE) + ## Usage Pre-requisites: @@ -24,6 +29,25 @@ Run the program: ./objs/srs-sip -c conf/config.yaml ``` +## Testing + +Run all tests: + +```bash +go test -v ./pkg/... +``` + +Run tests with coverage: + +```bash +go test ./pkg/... -coverprofile=coverage.out +go tool cover -func=coverage.out +``` + +For more details, see [Testing Guide](docs/TESTING.md). + +## Docker + Use docker ``` docker run -id -p 1985:1985 -p 5060:5060 -p 8025:8025 -p 9000:9000 -p 5060:5060/udp -p 8000:8000/udp --name srs-sip --env CANDIDATE=your_ip ossrs/srs-sip:alpha