From 71b2ec64b9987e48f1a52c8e69b0f665e3f3bcf7 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Fri, 11 May 2018 14:09:23 +0200 Subject: [PATCH] Add (automatic) testing --- ivatar/ivataraccount/.gitlab-ci.yml | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 ivatar/ivataraccount/.gitlab-ci.yml diff --git a/ivatar/ivataraccount/.gitlab-ci.yml b/ivatar/ivataraccount/.gitlab-ci.yml new file mode 100644 index 0000000..ddba967 --- /dev/null +++ b/ivatar/ivataraccount/.gitlab-ci.yml @@ -0,0 +1,53 @@ +image: centos:centos7 + +before_script: + - yum install -y -t https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + - yum -y -t install python34 python34-pip python34-devel unzip mysql-devel gcc git + - pip3 install virtualenv --upgrade + - virtualenv -p python3 /tmp/.virtualenv + - source /tmp/.virtualenv/bin/activate + - pip install -r requirements.txt + - pip install python-coveralls + - pip install coverage + - pip install pycco + +test_and_coverage: + stage: test + script: + - pushd ivatar + - python manage.py collectstatic --noinput + - coverage run --source . manage.py test -v3 + - coverage report --fail-under=70 + - coverage html + - popd + artifacts: + paths: + - ivatar/htmlcov/ + +pycco: + stage: test + script: + - /bin/true + - find ivatar/ -type f -name "*.py"|grep -v __pycache__|grep -v __init__.py|grep -v /migrations/ | xargs pycco -p -d pycco -i -s + artifacts: + paths: + - pycco/ + expire_in: 14 days + +pages: + before_script: + - /bin/true + - /bin/true + stage: deploy + dependencies: + - test_and_coverage + - pycco + script: + - mv ivatar/htmlcov/ public/ + - mv pycco/ public/ + artifacts: + paths: + - public + expire_in: 14 days + only: + - master