summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml13
1 files changed, 10 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4d1f844..1ed155c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,6 +5,11 @@ stages:
5 - linting 5 - linting
6 - test 6 - test
7 7
8.prepare_env: &prepare_env
9 before_script: # This is needed to not run the testsuite as root
10 - useradd --home-dir ${CI_PROJECT_DIR} mat2
11 - chown -R mat2 .
12
8linting:bandit: 13linting:bandit:
9 image: $CONTAINER_REGISTRY:linting 14 image: $CONTAINER_REGISTRY:linting
10 stage: linting 15 stage: linting
@@ -60,9 +65,10 @@ tests:debian_with_bubblewrap:
60 image: $CONTAINER_REGISTRY:debian 65 image: $CONTAINER_REGISTRY:debian
61 stage: test 66 stage: test
62 allow_failure: true 67 allow_failure: true
68 <<: *prepare_env
63 script: 69 script:
64 - python3-coverage run --branch -m unittest discover -s tests/ 70 - su - mat2 -c "python3-coverage run --branch -m unittest discover -s tests/"
65 - python3-coverage report --fail-under=100 -m --include 'libmat2/*' 71 - su - mat2 -c "python3-coverage report --fail-under=100 -m --include 'libmat2/*'"
66 72
67tests:fedora: 73tests:fedora:
68 image: $CONTAINER_REGISTRY:fedora 74 image: $CONTAINER_REGISTRY:fedora
@@ -74,5 +80,6 @@ tests:gentoo:
74 image: $CONTAINER_REGISTRY:gentoo 80 image: $CONTAINER_REGISTRY:gentoo
75 stage: test 81 stage: test
76 allow_failure: true 82 allow_failure: true
83 <<: *prepare_env
77 script: 84 script:
78 - python3 -m unittest discover -v 85 - su - mat2 -c "python3 -m unittest discover -v"