diff --git a/.gitignore b/.gitignore index 181c2ad..629adca 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ ghostream.yml # Test video and audio files *.ivf *.ogg + +# Coverage files +*.cov diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1302e8a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +stages: + - test + - quality-assurance + +unit_tests: + image: golang:1.15-alpine + stage: test + before_script: + - apk add --no-cache git build-base tcl pkgconfig cmake libressl-dev linux-headers + - git clone --depth 1 --branch v1.4.2 https://github.com/Haivision/srt && cd srt && ./configure --enable-apps=OFF && make install && cd .. && rm -rf srt + script: + - go test -v -covermode=count -coverprofile cover.cov ./... + - go tool cover -func=cover.cov + +linters: + image: golang:1.15-alpine + stage: quality-assurance + script: + - go get -u golang.org/x/lint/golint + - golint -min_confidence 0 -set_exit_status ./... diff --git a/README.md b/README.md index cc3e49c..8c3b15b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![pipeline status](https://gitlab.crans.org/nounous/ghostream/badges/master/pipeline.svg)](https://gitlab.crans.org/nounous/ghostream/commits/master) +[![coverage report](https://gitlab.crans.org/nounous/ghostream/badges/master/coverage.svg)](https://gitlab.crans.org/nounous/ghostream/-/commits/master) *Boooo!* A simple streaming server with authentication and open-source technologies. @@ -15,7 +16,7 @@ Features: ## Installation with Docker -An example is given in [docs/docker-compose.yml](doc/docker-compose.yml). +An example is given in [docs/docker-compose.yml](docs/docker-compose.yml). It uses Traefik reverse proxy. ## References