.gitlab-ci.yml 2.12 KB
Newer Older
jvoisin's avatar
jvoisin committed
1 2
image: debian

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

bandit:
  stage: linting
9
  script:  # TODO: remove B405 and B314
jvoisin's avatar
jvoisin committed
10 11
  - apt-get -qqy update
  - apt-get -qqy install --no-install-recommends python3-bandit
12
  - bandit ./mat2 --format txt --skip B101
jvoisin's avatar
jvoisin committed
13
  - bandit -r ./nautilus/ --format txt --skip B101
14
  - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314
jvoisin's avatar
jvoisin committed
15

jvoisin's avatar
jvoisin committed
16 17 18 19 20
pylint:
  stage: linting
  script:
  - apt-get -qqy update
  - apt-get -qqy install --no-install-recommends pylint3 python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0
jvoisin's avatar
jvoisin committed
21 22
  - pylint3 --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2
  # Once nautilus-python is in Debian, decomment it form the line below
23
  - pylint3 --extension-pkg-whitelist=Nautilus,GObject,Gtk,Gio,GLib,gi ./nautilus/mat2.py
jvoisin's avatar
jvoisin committed
24

jvoisin's avatar
jvoisin committed
25 26 27 28 29
pyflakes:
  stage: linting
  script:
  - apt-get -qqy update
  - apt-get -qqy install --no-install-recommends pyflakes3
jvoisin's avatar
jvoisin committed
30
  - pyflakes3 ./libmat2 ./mat2 ./tests/ ./nautilus
jvoisin's avatar
jvoisin committed
31

32 33 34 35 36 37
mypy:
  stage: linting
  script:
  - apt-get -qqy update
  - apt-get -qqy install --no-install-recommends python3-pip
  - pip3 install mypy
38
  - mypy --ignore-missing-imports mat2 libmat2/*.py ./nautilus/mat2.py
39

jvoisin's avatar
jvoisin committed
40
tests:debian:
jvoisin's avatar
jvoisin committed
41
  stage: test
jvoisin's avatar
jvoisin committed
42
  script:
43
  - apt-get -qqy update
44
  - apt-get -qqy install --no-install-recommends python3-mutagen python3-gi-cairo gir1.2-poppler-0.18 gir1.2-gdkpixbuf-2.0 libimage-exiftool-perl python3-coverage ffmpeg
jvoisin's avatar
jvoisin committed
45
  - python3-coverage run --branch -m unittest discover -s tests/
46
  - python3-coverage report --fail-under=100 -m --include 'libmat2/*'
jvoisin's avatar
jvoisin committed
47 48 49 50

tests:fedora:
  image: fedora
  stage: test
51 52
  tags:
    - whitewhale
jvoisin's avatar
jvoisin committed
53
  script:
jvoisin's avatar
jvoisin committed
54
  - dnf install -y python3 python3-mutagen python3-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject cairo python3-cairo perl-Image-ExifTool mailcap
jvoisin's avatar
jvoisin committed
55 56
  - gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
  - python3 setup.py test
jvoisin's avatar
jvoisin committed
57 58 59 60

tests:archlinux:
  image: archlinux/base
  stage: test
61 62
  tags:
    - whitewhale
jvoisin's avatar
jvoisin committed
63
  script:
64
  - pacman -Sy --noconfirm python-mutagen python-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 python-cairo perl-image-exiftool python-setuptools mailcap ffmpeg
jvoisin's avatar
jvoisin committed
65
  - python3 setup.py test