updating CI process + tests for code coverage

This commit is contained in:
Julien Neuhart
2019-08-20 12:06:08 +02:00
parent 09d07e4890
commit bb6a3471d5
5 changed files with 26 additions and 5 deletions

15
scripts/tests.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -e
DOCKER_REPOSITORY="$1"
CODE_COVERAGE="$2"
touch "$PWD/coverage.txt"
docker build -t "$DOCKER_REPOSITORY/gotenberg:tests" -f build/tests/Dockerfile .
if [ "$CODE_COVERAGE" = "1" ]; then
docker run --rm -e "CODE_COVERAGE=$CODE_COVERAGE" -v "$PWD/coverage.txt:/gotenberg/tests/coverage.txt" "$DOCKER_REPOSITORY/gotenberg:tests"
else
docker run --rm -e "CODE_COVERAGE=$CODE_COVERAGE" "$DOCKER_REPOSITORY/gotenberg:tests"
fi