From 2c8057c43a461b11881bd7db681e7da2cdf9053a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 17 Nov 2020 23:33:02 +0100 Subject: [PATCH] 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 --- .gitlab-ci.yml | 23 +++++++++++++++++++++++ ci/codecov-wrapper | 11 +++++++++++ 2 files changed, 34 insertions(+) create mode 100755 ci/codecov-wrapper diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b0aaf0c..77e9e0ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/ci/codecov-wrapper b/ci/codecov-wrapper new file mode 100755 index 00000000..cabbdf48 --- /dev/null +++ b/ci/codecov-wrapper @@ -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 "$@"