gitlab-ci: add tests job

- run tests in a vm runner to have LVM and loop devices access
- upload coverage data via wrapper to extract PR number
This commit is contained in:
Marek Marczykowski-Górecki 2020-11-17 23:33:02 +01:00
parent a40344252a
commit 2c8057c43a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 34 additions and 0 deletions

View File

@ -3,3 +3,26 @@ include:
file: '/r4.1/gitlab-base.yml'
- project: 'QubesOS/qubes-continuous-integration'
file: '/r4.1/gitlab-dom0.yml'
checks:pylint:
stage: checks
before_script:
- git clone https://github.com/QubesOS/qubes-core-qrexec ~/qubes-core-qrexec
- pip3 install --quiet -r ci/requirements.txt
script:
- PYTHONPATH=test-packages:~/qubes-core-qrexec pylint-3 qubes
checks:tests:
stage: checks
tags:
- short-living-job
- vm-runner
before_script:
- git clone https://github.com/QubesOS/qubes-core-qrexec ~/qubes-core-qrexec
- pip3 install --user --quiet -r ci/requirements.txt
# vim-common for xxd
- sudo dnf install -y lvm2 vim-common
script:
- PYTHONPATH=test-packages:~/qubes-core-qrexec ./run-tests
after_script:
- ci/codecov-wrapper -F unittests

11
ci/codecov-wrapper Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
PATH="$PATH:$HOME/.local/bin"
set -x
if [[ "$CI_COMMIT_BRANCH" =~ ^pr- ]]; then
PR=${CI_COMMIT_BRANCH#pr-}
exec codecov --pr "$PR" "$@"
fi
exec codecov "$@"