summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: c3a76c7ebbb0c9a12431c8279c11a2717b0ceace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
variables:
  CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images

stages:
  - linting
  - test

.prepare_env: &prepare_env
  before_script:  # This is needed to not run the testsuite as root
    - useradd --home-dir ${CI_PROJECT_DIR} mat2
    - chown -R mat2 .
  
linting:ruff:
  image: $CONTAINER_REGISTRY:linting
  stage: linting
  script:
    - apt update
    - apt install -qqy --no-install-recommends python3-venv
    - python3 -m venv venv
    - source venv/bin/activate
    - pip3 install ruff
    - ruff check .

linting:mypy:
  image: $CONTAINER_REGISTRY:linting
  stage: linting
  script:
    - mypy --ignore-missing-imports mat2 libmat2/*.py

tests:archlinux:
  image: $CONTAINER_REGISTRY:archlinux
  stage: test
  script:
    - python3 -m unittest discover -v
  
tests:debian:
  image: $CONTAINER_REGISTRY:debian
  stage: test
  <<: *prepare_env
  script:
    - apt-get -qqy purge bubblewrap
    - su - mat2 -c "python3-coverage run --branch -m unittest discover -s tests/"
    - su - mat2 -c "python3-coverage report --fail-under=95 -m --include 'libmat2/*'"

tests:debian_with_bubblewrap:
  image: $CONTAINER_REGISTRY:debian
  stage: test
  allow_failure: true
  <<: *prepare_env
  script:
    - apt-get -qqy install bubblewrap
    - python3 -m unittest discover -v

tests:fedora:
  image: $CONTAINER_REGISTRY:fedora
  stage: test
  script:
    - python3 -m unittest discover -v

tests:gentoo:
  image: $CONTAINER_REGISTRY:gentoo
  stage: test
  <<: *prepare_env
  script:
    - su - mat2 -c "python3 -m unittest discover -v"

tests:python3.7:
  image: $CONTAINER_REGISTRY:python3.7
  stage: test
  script:
    - python3 -m unittest discover -v

tests:python3.8:
  image: $CONTAINER_REGISTRY:python3.8
  stage: test
  script:
    - python3 -m unittest discover -v

tests:python3.9:
  image: $CONTAINER_REGISTRY:python3.9
  stage: test
  script:
    - python3 -m unittest discover -v

tests:python3.10:
  image: $CONTAINER_REGISTRY:python3.10
  stage: test
  script:
    - python3 -m unittest discover -v

tests:python3.11:
  image: $CONTAINER_REGISTRY:python3.11
  stage: test
  script:
    - python3 -m unittest discover -v