diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed5431d4c3c5600732743299d9a8320ecf64dd3b..b3f96014ce44731b99564ecdd3c33ee1403010e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,47 +1,42 @@ -test: - script: - - cp /keys/.pypirc ~/.pypirc - - virtualenv env - - source env/bin/activate - - XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools pytest pytest-django coverage - - XDG_CACHE_HOME=/cache pip3 install -U "git+https://github.com/pretix/pretix.git@master#egg=pretix&subdirectory=src" - - python setup.py develop - - make - - coverage run -m py.test tests - - coverage report - tags: - - python3 -style: - script: - - cp /keys/.pypirc ~/.pypirc - - virtualenv env - - source env/bin/activate - - XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools isort docformatter black flake8 check-manifest - - XDG_CACHE_HOME=/cache pip3 install -U "git+https://github.com/pretix/pretix.git@master#egg=pretix&subdirectory=src" - - python setup.py develop - - docformatter --check -r . - - black --check . - - isort -c . - - flake8 . - - check-manifest . - tags: - - python3 -pypi: - script: - - cp /keys/.pypirc ~/.pypirc - - virtualenv env - - source env/bin/activate - - XDG_CACHE_HOME=/cache pip3 install -U pip wheel setuptools twine check-manifest - - XDG_CACHE_HOME=/cache pip3 install -U pretix - - python setup.py develop - - python setup.py sdist bdist_wheel - - check-manifest . - - twine check dist/* - - twine upload dist/* - tags: - - python3 - only: - - pypi - artifacts: - paths: - - dist/ +--- +stages: + - linting +# 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/pip" +cache: + paths: + - .cache + +docformatter: + stage: linting + image: python:3 + before_script: + - pip3 install -U pip docformatter + script: + - docformatter --check -r . + +black: + stage: linting + image: python:3 + before_script: + - pip3 install -U pip black + script: + - black --check . + +isort: + stage: linting + image: python:3 + before_script: + - pip3 install -U pip isort + script: + - isort -c . + +flake8: + stage: linting + image: python:3 + before_script: + - pip3 install -U pip flake8 + script: + - flake8 .