]> kaliko git repositories - mpd-sima.git/blobdiff - .gitlab-ci.yml
Cleanup PlayerError exception wrapper
[mpd-sima.git] / .gitlab-ci.yml
index 7a68469feae7406d94b344f2593434376fcbc22a..ad63ee2b930e8adb55be3d3727d41d721c203e19 100644 (file)
@@ -1,63 +1,75 @@
 # Official language image. Look for the different tagged releases at:
-# https://hub.docker.com/r/library/python/
+# https://hub.docker.com/_/python
 image: python:3
 
-stages:
-  - test
-  - build
+include:
+  - local: .gitlab/gitlab-templates.yml
+  - local: .gitlab/pylint.yml
+  - template: Jobs/SAST.gitlab-ci.yml
 
-# Change pip's cache directory to be inside the project directory since we can
-# only cache local items.
 variables:
-  PIP_CACHE_DIR: "$CI_PROJECT_DIR/cache"
+  #XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
+  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
+  SAST_EXCLUDED_ANALYZERS: brakeman, flawfinder, kubesec, mobsf, nodejs-scan,
+    phpcs-security-audit, pmd-apex, sobelow, spotbugs
 
-# Pip's cache doesn't store the python packages
-# https://pip.pypa.io/en/stable/reference/pip_install/#caching
-#
-# If you want to also cache the installed packages, you have to install
-# them in a virtualenv and cache it as well.
 cache:
   paths:
-    - cache/pip
-    - venv/
+    - .cache
 
-before_script:
-  - python -V               # Print out python version for debugging
-  - python -m venv venv
-  - source venv/bin/activate
+stages:
+  - test
+  - build
 
-test:
+smoketest:
   stage: test
   script:
-  - pip install pytest-cov requests
-  - py.test -q --cov=sima tests
+  - pip install requests python-musicpd sphinx
   - python setup.py test
-  - pip install tox flake8
-  - tox -e py36,flake8
-
-run:
-  stage: test
-  script:
+  # build wheel and source
   - python setup.py bdist_wheel sdist
-  - pip install dist/*
+  # manual and HTML documentation
+  - sphinx-build -d ./build/doctrees doc/source -b man ./build/man/
+  - sphinx-build -d ./build/doctrees doc/source -b html ./build/html/
+  # install
+  - pip install dist/*.whl
+  # smoke test
   - mpd-sima --help
-  cache:
-    paths:
-      - dist/
-    policy: pull
+  - TRACE=y ./mpd-sima -d --pid ./mpd-sima.pid -l ./mpd-sima.log
+  - sleep 10
+  - test -f ./mpd-sima.pid && kill $(cat ./mpd-sima.pid)
   artifacts:
+    expire_in: 1 hour
     paths:
     - dist/*.whl
+    - dist/*.tar.gz
+    - dist/*.zip
+    - ./mpd-sima.pid
+    - ./mpd-sima.log
+
+unittests:
+  stage: test
+  script:
+  - pip install pytest-cov requests python-musicpd
+  - py.test -q --cov=sima --junitxml=report.xml tests
+  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
+  artifacts:
+    when: always
+    reports:
+      junit: report.xml
 
 tag_release:
   stage: build
+  dependencies:
+    - smoketest
   script:
-  - python -V
+    - python -V
   artifacts:
     paths:
     - dist/*.whl
     - dist/*.tar.gz
     - dist/*.zip
     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
+  cache: {}
   only:
     - tags