FreedomBox/.gitlab-ci.yml
Veiko Aasa 962e5b488f
storage: Tests for the directory validation action
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-26 16:37:01 -05:00

43 lines
1.4 KiB
YAML

image: debian:unstable
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get build-dep -y . # Dependencies of the plinth Debian package
- apt-get install -y build-essential # Build dependencies
- apt-get install -y sshpass parted # Test dependencies
- apt-get install -y sudo
- apt-mark hold fuse fuse3 # not installable in CI environment
- apt-get install -y $(./run --list-dependencies) # Module dependencies
stages:
- test
- package
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; python3 -m flake8 --exclude actions/domainname-change,actions/dynamicdns,actions/hostname-change,actions/networks plinth actions/*" tester
- su -c "cd ~/plinth;PYTHONPATH='.' py.test-3 --cov=plinth --cov-report=html:/home/tester/plinth/htmlcov --cov-report=term" tester
- cp -r /home/tester/plinth/htmlcov test-coverage-report
coverage: '/^TOTAL\s+.*\s+(\d+\.\d+%)$/'
artifacts:
paths:
- test-coverage-report/*
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/*