]> kaliko git repositories - mpd-sima.git/blob - .gitlab-ci.yml
b76ca1788fd9c9e5b73d05a0662d5b0208a1f72d
[mpd-sima.git] / .gitlab-ci.yml
1 # Official language image. Look for the different tagged releases at:
2 # https://hub.docker.com/_/python
3 image: python:3
4
5 include:
6   - local: .gitlab/gitlab-templates.yml
7   - local: .gitlab/pylint.yml
8   - template: Security/SAST.gitlab-ci.yml
9
10 variables:
11   #XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
12   PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
13
14 cache:
15   paths:
16     - .cache
17
18 stages:
19   - test
20   - build
21
22 smoketest:
23   stage: test
24   script:
25   - pip install requests python-musicpd sphinx
26   - python setup.py test
27   # build wheel and source
28   - python setup.py bdist_wheel sdist
29   # manual and HTML documentation
30   - python setup.py build_sphinx
31   # install
32   - pip install dist/*.whl
33   # smoke test
34   - mpd-sima --help
35   - TRACE=y ./mpd-sima -d --pid ./mpd-sima.pid -l ./mpd-sima.log
36   - sleep 10
37   - test -f ./mpd-sima.pid && kill $(cat ./mpd-sima.pid)
38   artifacts:
39     expire_in: 1 hour
40     paths:
41     - dist/*.whl
42     - dist/*.tar.gz
43     - dist/*.zip
44     - ./mpd-sima.pid
45     - ./mpd-sima.log
46
47 unittests:
48   stage: test
49   script:
50   - pip install pytest-cov requests python-musicpd
51   - py.test -q --cov=sima --junitxml=report.xml tests
52   coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
53   artifacts:
54     when: always
55     reports:
56       junit: report.xml
57
58 vinstall:
59   stage: test
60   script:
61   # test virtualenv install
62   - python3 ./vinstall.py
63   # smoke test
64   - ./vmpd-sima --help
65   artifacts:
66     expire_in: 1 hour
67
68 sast:
69   variables:
70     SAST_EXCLUDED_ANALYZERS: brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan,
71       phpcs-security-audit, pmd-apex, security-code-scan, semgrep, sobelow, spotbugs
72   stage: test
73
74 tag_release:
75   stage: build
76   dependencies:
77     - smoketest
78   script:
79     - python -V
80   artifacts:
81     paths:
82     - dist/*.whl
83     - dist/*.tar.gz
84     - dist/*.zip
85     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
86   cache: {}
87   only:
88     - tags