.gitlab-ci.yml 2.56 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
45 46 47 48 49 50 51 52 53 54 55
  - apt-get -qqy purge bubblewrap
  - python3-coverage run --branch -m unittest discover -s tests/
  - python3-coverage report --fail-under=90 -m --include 'libmat2/*'

tests:debian_with_bubblewrap:
  stage: test
  tags:
    - whitewhale
  script:
  - apt-get -qqy update
  - 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 bubblewrap
jvoisin's avatar
jvoisin committed
56
  - python3-coverage run --branch -m unittest discover -s tests/
57
  - python3-coverage report --fail-under=100 -m --include 'libmat2/*'
jvoisin's avatar
jvoisin committed
58 59 60 61

tests:fedora:
  image: fedora
  stage: test
62 63
  tags:
    - whitewhale
jvoisin's avatar
jvoisin committed
64
  script:
jvoisin's avatar
jvoisin committed
65
  - 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
66 67
  - 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
68 69 70 71

tests:archlinux:
  image: archlinux/base
  stage: test
72 73
  tags:
    - whitewhale
jvoisin's avatar
jvoisin committed
74
  script:
75
  - 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
76
  - python3 setup.py test