]> kaliko git repositories - mpd-sima.git/blob - .gitlab-ci.yml
doc: Add publish target
[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
26   - python setup.py test
27   # build wheel and source
28   - python setup.py bdist_wheel sdist
29   # install
30   - pip install dist/*.whl
31   # smoke test
32   - mpd-sima --help
33   artifacts:
34     expire_in: 1 hour
35     paths:
36     - dist/*.whl
37     - dist/*.tar.gz
38     - dist/*.zip
39
40 unittests:
41   stage: test
42   script:
43   - pip install pytest-cov requests python-musicpd
44   - py.test -q --cov=sima --junitxml=report.xml tests
45   artifacts:
46     when: always
47     reports:
48       junit: report.xml
49
50 vinstall:
51   stage: test
52   script:
53   # test virtualenv install
54   - python3 ./vinstall.py
55   # smoke test
56   - ./vmpd-sima --help
57   artifacts:
58     expire_in: 1 hour
59
60 sast:
61   variables:
62     SAST_EXCLUDED_ANALYZERS: brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan,
63       phpcs-security-audit, pmd-apex, security-code-scan, semgrep, sobelow, spotbugs
64   stage: test
65
66 tag_release:
67   stage: build
68   dependencies:
69     - smoketest
70   script:
71     - python -V
72   artifacts:
73     paths:
74     - dist/*.whl
75     - dist/*.tar.gz
76     - dist/*.zip
77     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
78   cache: {}
79   only:
80     - tags