2020-07-18 17:40:33 +02:00
|
|
|
image: python
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- linters
|
|
|
|
- tests
|
2020-07-18 18:35:22 +02:00
|
|
|
- release
|
2020-07-18 17:40:33 +02:00
|
|
|
|
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip"
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- vendor
|
|
|
|
|
2020-07-18 18:35:22 +02:00
|
|
|
# ---
|
|
|
|
# Linters
|
|
|
|
# ---
|
|
|
|
|
2020-07-18 17:40:33 +02:00
|
|
|
linters:
|
|
|
|
stage: linters
|
|
|
|
before_script:
|
|
|
|
- mkdir -p vendor/pip
|
|
|
|
- pip install --upgrade black isort flake8
|
|
|
|
script:
|
|
|
|
- black --check .
|
|
|
|
- isort --check --diff .
|
|
|
|
- flake8 --exit-zero authens
|
|
|
|
|
2020-07-18 18:35:22 +02:00
|
|
|
# ---
|
|
|
|
# Test suite
|
|
|
|
# ---
|
|
|
|
|
2020-07-18 17:40:33 +02:00
|
|
|
before_script:
|
|
|
|
- mkdir -p vendor/{apt,pip}
|
|
|
|
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq python3-dev libldap2-dev libsasl2-dev
|
|
|
|
- pip install tox
|
|
|
|
|
|
|
|
python35:
|
|
|
|
image: python:3.5
|
|
|
|
stage: tests
|
|
|
|
script:
|
|
|
|
- tox -e py35-django22
|
|
|
|
|
|
|
|
python36:
|
|
|
|
image: python:3.6
|
|
|
|
stage: tests
|
|
|
|
script:
|
|
|
|
- tox -e py36-django22
|
|
|
|
- tox -e py36-django30
|
|
|
|
|
|
|
|
python37:
|
|
|
|
image: python:3.7
|
|
|
|
stage: tests
|
|
|
|
script:
|
|
|
|
- tox -e py37-django22
|
|
|
|
- tox -e py37-django30
|
|
|
|
|
|
|
|
python38:
|
|
|
|
image: python:3.8
|
|
|
|
stage: tests
|
|
|
|
script:
|
|
|
|
- tox -e py38-django22
|
|
|
|
- tox -e py38-django30
|
2020-07-18 18:35:22 +02:00
|
|
|
|
|
|
|
# ---
|
|
|
|
# Release artifacts
|
|
|
|
# ---
|
|
|
|
|
|
|
|
build_wheels:
|
|
|
|
stage: release
|
|
|
|
image: python
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*
|
|
|
|
when: on_success
|
|
|
|
before_script:
|
|
|
|
- pip install --upgrade setuptools wheel
|
|
|
|
script:
|
2020-07-30 11:56:18 +02:00
|
|
|
- python setup.py sdist
|