X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=.gitlab-ci.yml;h=3bd74453b6319b76cf4da936777051a311a1ed43;hb=0f198b5c08dad8fa7d03a70ee57d9142c4e73d21;hp=7a68469feae7406d94b344f2593434376fcbc22a;hpb=8beb94787ac5c6345c21720ae2e5fdd8a0247200;p=mpd-sima.git diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7a68469..3bd7445 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,63 +1,73 @@ # Official language image. Look for the different tagged releases at: -# https://hub.docker.com/r/library/python/ +# https://hub.docker.com/_/python image: python:3 -stages: - - test - - build +include: + - local: .gitlab/gitlab-templates.yml + - local: .gitlab/pylint.yml -# Change pip's cache directory to be inside the project directory since we can -# only cache local items. variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/cache" + #XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache" -# Pip's cache doesn't store the python packages -# https://pip.pypa.io/en/stable/reference/pip_install/#caching -# -# If you want to also cache the installed packages, you have to install -# them in a virtualenv and cache it as well. cache: paths: - - cache/pip - - venv/ + - .cache -before_script: - - python -V # Print out python version for debugging - - python -m venv venv - - source venv/bin/activate +stages: + - test + - build -test: +smoketest: stage: test script: - - pip install pytest-cov requests - - py.test -q --cov=sima tests + - pip install requests - python setup.py test - - pip install tox flake8 - - tox -e py36,flake8 - -run: - stage: test - script: + # build wheel and source - python setup.py bdist_wheel sdist - - pip install dist/* + # install + - pip install dist/*.whl + # smoke test - mpd-sima --help - cache: - paths: - - dist/ - policy: pull artifacts: + expire_in: 1 hour paths: - dist/*.whl + - dist/*.tar.gz + - dist/*.zip + +unittests: + stage: test + script: + - pip install pytest-cov requests + - py.test -q --cov=sima --junitxml=report.xml tests + artifacts: + when: always + reports: + junit: report.xml + +vinstall: + stage: test + script: + # test virtualenv install + - python3 ./vinstall.py + # smoke test + - ./vmpd-sima --help + artifacts: + expire_in: 1 hour tag_release: stage: build + dependencies: + - smoketest script: - - python -V + - python -V artifacts: paths: - dist/*.whl - dist/*.tar.gz - dist/*.zip name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG" + cache: {} only: - tags