FreedomBox/.gitlab-ci.yml
Joseph Nuthalapati a1ce12980a
ci: Add --cov-config to the coverage command
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-11-12 10:18:14 -05:00

48 lines
1.4 KiB
YAML

# SPDX-License-Identifier: AGPL-3.0-or-later
image: registry.salsa.debian.org/freedombox-team/freedombox:gitlabci
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get build-dep -y . # Dependencies of the plinth Debian package
- apt-get install -y $(./run --list-dependencies) # Module dependencies
stages:
- test
- package
run-code-quality-tests:
stage: test
script:
- python3 -m flake8 --exclude actions/domainname-change,actions/dynamicdns,actions/hostname-change,actions/networks plinth actions/*
run-unit-tests:
stage: test
script:
- adduser tester --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
- echo "tester:password" | chpasswd
- cp -r . /home/tester/plinth
- chown -R tester:tester /home/tester/plinth
- su -c "cd ~/plinth;PYTHONPATH='.' py.test-3 --cov=plinth --cov-report=html:/home/tester/plinth/htmlcov --cov-config=.coveragerc --cov-report=term" tester
- cp -r /home/tester/plinth/htmlcov test-coverage-report
coverage: '/^TOTAL\s+.*\s+(\d+\.\d+%)$/'
artifacts:
paths:
- test-coverage-report/*
run-doc-tests:
stage: test
script:
- doc/scripts/wikiparser.py
build-debian-package:
stage: package
script:
- DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b
- mkdir debian-package
- mv ../freedombox*.deb debian-package
artifacts:
paths:
- debian-package/*