From fa381c73acd592520ab335846c8ba1a902bce47f Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 13 Feb 2021 20:13:23 +0100 Subject: [PATCH] add codecov --- .github/workflows/test.yml | 8 +++++++- .gitignore | 1 + Makefile | 16 ++++++++++------ README.md | 3 ++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76ee9c13..22cafc7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,4 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - - run: make test + - uses: actions/setup-go@v2 + with: + go-version: "1.15" + + - run: make test-nodocker + + - run: bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index ae196a03..ac081e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /tmp /release +/coverage*.txt diff --git a/Makefile b/Makefile index ae6d5a19..049080a6 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,16 @@ COPY . ./ endef export DOCKERFILE_TEST +test-internal: + go test -v -race -coverprofile=coverage-internal.txt ./internal/... + +test-root: + $(foreach IMG,$(shell echo testimages/*/ | xargs -n1 basename), \ + docker build -q testimages/$(IMG) -t rtsp-simple-server-test-$(IMG)$(NL)) + go test -v -race -coverprofile=coverage-root.txt . + +test-nodocker: test-internal test-root + test: echo "$$DOCKERFILE_TEST" | docker build -q . -f - -t temp docker run --rm \ @@ -50,12 +60,6 @@ test: temp \ make test-nodocker -test-nodocker: - $(foreach IMG,$(shell echo testimages/*/ | xargs -n1 basename), \ - docker build -q testimages/$(IMG) -t rtsp-simple-server-test-$(IMG)$(NL)) - go test -race -v ./internal/... - go test -race -v . - lint: docker run --rm -v $(PWD):/app -w /app \ $(LINT_IMAGE) \ diff --git a/README.md b/README.md index 2ae743c4..a863dff1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Test](https://github.com/aler9/rtsp-simple-server/workflows/test/badge.svg)](https://github.com/aler9/rtsp-simple-server/actions?query=workflow:test) [![Lint](https://github.com/aler9/rtsp-simple-server/workflows/lint/badge.svg)](https://github.com/aler9/rtsp-simple-server/actions?query=workflow:lint) +[![CodeCov](https://codecov.io/gh/aler9/rtsp-simple-server/branch/main/graph/badge.svg)](https://codecov.io/gh/aler9/rtsp-simple-server/branch/main) [![Docker Hub](https://img.shields.io/badge/docker-aler9%2Frtsp--simple--server-blue)](https://hub.docker.com/r/aler9/rtsp-simple-server) _rtsp-simple-server_ is a simple, ready-to-use and zero-dependency RTSP/RTMP server and proxy, a software that allows users to publish, read and proxy live video and audio streams. RTSP is a specification that describes how to perform these operations with the help of a server, that is contacted by both publishers and readers and relays the publisher's streams to the readers. @@ -16,7 +17,7 @@ Features: * Serve multiple streams at once in separate paths * Encrypt streams with TLS (RTSPS) * Authenticate readers and publishers -* Redirect to other RTSP servers (load balancing) +* Redirect readers to other RTSP servers (load balancing) * Run custom commands when clients connect, disconnect, read or publish streams * Reload the configuration without disconnecting existing clients (hot reloading) * Compatible with Linux, Windows and macOS, does not require any dependency or interpreter, it's a single executable