1
0
mirror of synced 2024-11-24 18:24:23 +01:00
mat2/.gitlab-ci.yml

89 lines
2.7 KiB
YAML
Raw Normal View History

2022-04-02 16:19:02 +02:00
include:
- template: Security/SAST.gitlab-ci.yml
variables:
CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
2018-03-27 20:58:21 +02:00
2018-05-01 00:01:18 +02:00
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:bandit:
image: $CONTAINER_REGISTRY:linting
2018-05-01 00:01:18 +02:00
stage: linting
script: # TODO: remove B405 and B314
- bandit ./mat2 --format txt --skip B101
- bandit -r ./nautilus/ --format txt --skip B101
2020-03-08 12:17:56 +01:00
- bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314,B108,B311
2018-05-01 00:01:18 +02:00
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
linting:pylint:
image: $CONTAINER_REGISTRY:linting
2018-07-09 01:12:59 +02:00
stage: linting
script:
- pylint --disable=no-else-return,no-else-raise,no-else-continue,unnecessary-comprehension,raise-missing-from,unsubscriptable-object,use-dict-literal,unspecified-encoding,consider-using-f-string,use-list-literal,too-many-statements --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2
# Once nautilus-python is in Debian, decomment it form the line below
2021-11-23 17:36:17 +01:00
- pylint --disable=no-else-return,no-else-raise,no-else-continue,unnecessary-comprehension,raise-missing-from,unsubscriptable-object,use-list-literal --extension-pkg-whitelist=Nautilus,GObject,Gtk,Gio,GLib,gi ./nautilus/mat2.py
2018-07-09 01:12:59 +02:00
linting:pyflakes:
image: $CONTAINER_REGISTRY:linting
2018-05-01 00:01:18 +02:00
stage: linting
script:
- pyflakes3 ./libmat2 ./mat2 ./tests/ ./nautilus
2018-05-01 00:01:18 +02:00
linting:mypy:
image: $CONTAINER_REGISTRY:linting
2018-06-04 22:54:01 +02:00
stage: linting
script:
- mypy --ignore-missing-imports mat2 libmat2/*.py ./nautilus/mat2.py
2018-06-04 22:54:01 +02:00
tests:archlinux:
image: $CONTAINER_REGISTRY:archlinux
stage: test
script:
- python3 -m unittest discover -v
2018-06-12 22:40:57 +02:00
tests:debian:
image: $CONTAINER_REGISTRY:debian
2018-05-01 00:01:18 +02:00
stage: test
2021-10-03 19:52:45 +02:00
<<: *prepare_env
2018-03-25 17:42:29 +02:00
script:
- apt-get -qqy purge bubblewrap
2021-10-03 19:52:45 +02:00
- 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
2021-05-05 21:04:29 +02:00
allow_failure: true
<<: *prepare_env
script:
2021-10-03 19:52:45 +02:00
- apt-get -qqy install bubblewrap
- python3 -m unittest discover -v
2018-06-12 22:40:57 +02:00
tests:fedora:
image: $CONTAINER_REGISTRY:fedora
2018-06-12 22:40:57 +02:00
stage: test
script:
- python3 -m unittest discover -v
2018-09-01 15:07:01 +02:00
tests:gentoo:
image: $CONTAINER_REGISTRY:gentoo
2018-09-01 15:07:01 +02:00
stage: test
<<: *prepare_env
2018-09-01 15:07:01 +02:00
script:
- su - mat2 -c "python3 -m unittest discover -v"