]> kaliko git repositories - mpd-sima.git/blob - .gitlab-ci.yml
Add gitlab ci
[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
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: dist/
46     policy: pull
47   artifacts:
48     paths:
49     - dist/*.whl
50
51 tag_release:
52   stage: build
53   script:
54   - python -V
55   artifacts:
56     paths:
57     - dist/*.whl
58     - dist/*.tar.gz
59     - dist/*.zip
60     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
61   only:
62     - tags