Skip to content
Snippets Groups Projects
.gitlab-ci.yml 927 B
Newer Older
Daniel Palomar's avatar
Daniel Palomar committed
before_script:
  - pip install tox setuptools
cache:
  paths:
  - /root/.cache
image: python:3.8
Daniel Palomar's avatar
Daniel Palomar committed
stages:
  - style
  - test
  - package

Daniel Palomar's avatar
Daniel Palomar committed
py38:
  stage: test
  script:
    - tox -e py38
  rules:
    - when: always
Daniel Palomar's avatar
Daniel Palomar committed

Daniel Palomar's avatar
Daniel Palomar committed
pep8:
  stage: style
  script:
    - tox -e pep8
  rules:
    - when: always
Daniel Palomar's avatar
Daniel Palomar committed

wheel:
  stage: package
  script:
    tox -e wheel
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master'

sdist:
  stage: package
  script:
    tox -e sdist
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'master'

publish:
  stage: package
  script:
    - pip install twine
    - echo 'Building Source and Wheel (universal) distribution…'
    - python setup.py sdist bdist_wheel --universal
    - echo 'Uploading the package to PyPI via Twine…'
    - twine upload dist/*
  artifacts:
    paths:
      - dist/
  rules:
    - if: $CI_COMMIT_TAG