]> kaliko git repositories - mpd-sima.git/blob - .gitlab-ci.yml
195423eef5542b2da4108e14bfb2b61a304ccb6f
[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   artifacts:
53     when: always
54     reports:
55       junit: report.xml
56
57 vinstall:
58   stage: test
59   script:
60   # test virtualenv install
61   - python3 ./vinstall.py
62   # smoke test
63   - ./vmpd-sima --help
64   artifacts:
65     expire_in: 1 hour
66
67 sast:
68   variables:
69     SAST_EXCLUDED_ANALYZERS: brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan,
70       phpcs-security-audit, pmd-apex, security-code-scan, semgrep, sobelow, spotbugs
71   stage: test
72
73 tag_release:
74   stage: build
75   dependencies:
76     - smoketest
77   script:
78     - python -V
79   artifacts:
80     paths:
81     - dist/*.whl
82     - dist/*.tar.gz
83     - dist/*.zip
84     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
85   cache: {}
86   only:
87     - tags