]> kaliko git repositories - mpd-sima.git/blob - .gitlab-ci.yml
ci: Fixed missing dependency for tests
[mpd-sima.git] / .gitlab-ci.yml
1 # Official language image. Look for the different tagged releases at:
2 # https://hub.docker.com/r/library/python/
3 image: python:3
4
5 stages:
6   - test
7   - build
8
9 # Change pip's cache directory to be inside the project directory since we can
10 # only cache local items.
11 variables:
12   PIP_CACHE_DIR: "$CI_PROJECT_DIR/cache"
13
14 # Pip's cache doesn't store the python packages
15 # https://pip.pypa.io/en/stable/reference/pip_install/#caching
16 #
17 # If you want to also cache the installed packages, you have to install
18 # them in a virtualenv and cache it as well.
19 cache:
20   paths:
21     - cache/pip
22     - venv/
23
24 before_script:
25   - python -V               # Print out python version for debugging
26   - python -m venv venv
27   - source venv/bin/activate
28
29 test:
30   stage: test
31   script:
32   - pip install pytest-cov requests
33   - py.test -q --cov=sima tests
34   - python setup.py test
35   - pip install tox flake8
36   - tox -e py36,flake8
37
38 run:
39   stage: test
40   script:
41   - python setup.py bdist_wheel sdist
42   - pip install dist/*
43   - mpd-sima --help
44   cache:
45     paths:
46       - dist/
47     policy: pull
48   artifacts:
49     paths:
50     - dist/*.whl
51
52 tag_release:
53   stage: build
54   script:
55   - python -V
56   artifacts:
57     paths:
58     - dist/*.whl
59     - dist/*.tar.gz
60     - dist/*.zip
61     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
62   only:
63     - tags