From a67eecec57867a051eea9ff1c6c31c622ffaaf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= <felix@thegcat.net> Date: Fri, 4 Feb 2022 15:54:29 +0100 Subject: [PATCH] Update gitlab-ci.yml --- .gitlab-ci.yml | 89 ++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed5431d..b3f9601 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 . -- GitLab