.gitlab-ci.yml 2.27 KB
Newer Older
1 2
variables:
  CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
jvoisin's avatar
jvoisin committed
3

jvoisin's avatar
jvoisin committed
4 5 6 7
stages:
  - linting
  - test

8 9 10 11 12
.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 .

13
linting:bandit:
14
  image: $CONTAINER_REGISTRY:linting 
jvoisin's avatar
jvoisin committed
15
  stage: linting
16
  script:  # TODO: remove B405 and B314
17 18
    - bandit ./mat2 --format txt --skip B101
    - bandit -r ./nautilus/ --format txt --skip B101
19
    - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314,B108
jvoisin's avatar
jvoisin committed
20

21 22 23 24 25 26 27 28 29
linting:codespell:
  image: $CONTAINER_REGISTRY:linting
  stage: linting
  script:
    # Run codespell to check for spelling errors; ignore errors about binary
    # files, use a config with ignored words and exclude the git directory,
    # which might contain false positives
    - codespell -q 2 -I utils/ci/codespell/ignored_words.txt -S .git
  
30
linting:pylint:
31
  image: $CONTAINER_REGISTRY:linting
jvoisin's avatar
jvoisin committed
32 33
  stage: linting
  script:
34 35 36
    - pylint3 --disable=no-else-return --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2
    # Once nautilus-python is in Debian, decomment it form the line below
    - pylint3 --disable=no-else-return --extension-pkg-whitelist=Nautilus,GObject,Gtk,Gio,GLib,gi ./nautilus/mat2.py
jvoisin's avatar
jvoisin committed
37

38
linting:pyflakes:
39
  image: $CONTAINER_REGISTRY:linting
jvoisin's avatar
jvoisin committed
40 41
  stage: linting
  script:
42
    - pyflakes3 ./libmat2 ./mat2 ./tests/ ./nautilus
jvoisin's avatar
jvoisin committed
43

44
linting:mypy:
45
  image: $CONTAINER_REGISTRY:linting
46 47
  stage: linting
  script:
48
    - mypy --ignore-missing-imports mat2 libmat2/*.py ./nautilus/mat2.py
49

50 51 52 53 54 55
tests:archlinux:
  image: $CONTAINER_REGISTRY:archlinux
  stage: test
  script:
    - python3 setup.py test
  
jvoisin's avatar
jvoisin committed
56
tests:debian:
57
  image: $CONTAINER_REGISTRY:debian
jvoisin's avatar
jvoisin committed
58
  stage: test
jvoisin's avatar
jvoisin committed
59
  script:
60
    - apt-get -qqy purge bubblewrap
jvoisin's avatar
jvoisin committed
61
    - python3 setup.py test
62 63

tests:debian_with_bubblewrap:
64
  image: $CONTAINER_REGISTRY:debian
65
  stage: test
66
  <<: *prepare_env
67
  script:
68 69
    - su - mat2 -c "python3-coverage run --branch -m unittest discover -s tests/"
    - su - mat2 -c "python3-coverage report --fail-under=100 -m --include 'libmat2/*'"
jvoisin's avatar
jvoisin committed
70 71

tests:fedora:
72
  image: $CONTAINER_REGISTRY:fedora
jvoisin's avatar
jvoisin committed
73 74
  stage: test
  script:
75
    - python3 setup.py test
jvoisin's avatar
jvoisin committed
76

77 78
tests:gentoo:
  image: $CONTAINER_REGISTRY:gentoo
jvoisin's avatar
jvoisin committed
79
  stage: test
80
  <<: *prepare_env
jvoisin's avatar
jvoisin committed
81
  script:
82
    - su - mat2 -c "python3 -m unittest discover -v"