From e607a47617a3c602298872ff25a4df9aa6fbf66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 18 Jul 2020 17:40:33 +0200 Subject: [PATCH] Tox + CI --- .gitignore | 5 ++++- .gitlab-ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 13 ++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index e817f4d..8351c11 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ __pycache__ # Vim *.swp -*.swo \ No newline at end of file +*.swo + +# Tests +.tox diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..073fdbd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,54 @@ +image: python + +stages: + - linters + - tests + +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip" + +cache: + paths: + - vendor + +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 + +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 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2e4d276 --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +envlist = + py{35,36,37,38}-django22, + py{36,37,38}-django30 + +[testenv] +deps = + django22: Django==2.2.* + django30: Django==3.0.* + python-cas +commands = + python --version + python runtests.py