Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Circle CI integration #60

Merged
merged 12 commits into from
Feb 20, 2020
7 changes: 7 additions & 0 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG PYTHON_VERSION=3.6
FROM circleci/python:$PYTHON_VERSION

WORKDIR /home/circleci/app/
COPY . /home/circleci/app/
RUN sudo chown -R circleci:circleci .
RUN sudo pip install tox
146 changes: 146 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
version: 2.0

py34default: &py34default
docker:
- image: circleci/python:3.4
steps:
- setup_remote_docker:
docker_layer_caching: false
- checkout
- attach_workspace:
at: /tmp/images
- run: docker load -i /tmp/images/py34.tar || true
- run: docker run py34 tox -e $CIRCLE_STAGE

py35default: &py35default
docker:
- image: circleci/python:3.5
steps:
- setup_remote_docker:
docker_layer_caching: false
- checkout
- attach_workspace:
at: /tmp/images
- run: docker load -i /tmp/images/py35.tar || true
- run: docker run py35 tox -e $CIRCLE_STAGE

py36default: &py36default
docker:
- image: circleci/python:3.6
steps:
- setup_remote_docker:
docker_layer_caching: false
- checkout
- attach_workspace:
at: /tmp/images
- run: docker load -i /tmp/images/py36.tar || true
- run: docker run py36 tox -e $CIRCLE_STAGE

py34_requires: &py34_requires
requires:
- py34_base

py35_requires: &py35_requires
requires:
- py35_base

py36_requires: &py36_requires
requires:
- py36_base

jobs:
py34_base:
docker:
- image: circleci/python:3.4
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: false
- run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.4 -t py34 .
- run: mkdir images
- run: docker save -o images/py34.tar py34
- persist_to_workspace:
root: images
paths: py34.tar
py35_base:
docker:
- image: circleci/python:3.5
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: false
- run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.5 -t py35 .
- run: mkdir images
- run: docker save -o images/py35.tar py35
- persist_to_workspace:
root: images
paths: py35.tar
py36_base:
docker:
- image: circleci/python:3.6
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: false
- run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.6 -t py36 .
- run: mkdir images
- run: docker save -o images/py36.tar py36
- persist_to_workspace:
root: images
paths: py36.tar

flake8:
<<: *py35default
isort:
<<: *py35default
py34-dj111-sqlite-cms40:
<<: *py34default
py35-dj111-sqlite-cms40:
<<: *py35default
py36-dj111-sqlite-cms40:
<<: *py36default
py35-dj20-sqlite-cms40:
<<: *py35default
py36-dj20-sqlite-cms40:
<<: *py36default
py35-dj21-sqlite-cms40:
<<: *py35default
py36-dj21-sqlite-cms40:
<<: *py36default

#######################

workflows:
version: 2
build:
jobs:
- py34_base
- py35_base
- py36_base
- flake8:
requires:
- py35_base
- isort:
requires:
- py35_base
- py34-dj111-sqlite-cms40:
requires:
- py34_base
- py35-dj111-sqlite-cms40:
requires:
- py35_base
- py36-dj111-sqlite-cms40:
requires:
- py36_base
- py35-dj20-sqlite-cms40:
requires:
- py35_base
- py36-dj20-sqlite-cms40:
requires:
- py36_base
- py35-dj21-sqlite-cms40:
requires:
- py35_base
- py36-dj21-sqlite-cms40:
requires:
- py36_base
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@


INSTALL_REQUIREMENTS = [
'Django>=1.11,<2.1',
'Django>=1.11,<2.2'
'django-cms>=3.5',
]

TEST_REQUIREMENTS = [
"djangocms_helper",
'djangocms_text_ckeditor',
'djangocms_versioning',
"factory-boy",
]

setup(
name='djangocms-version-locking',
Expand All @@ -26,7 +32,13 @@
install_requires=INSTALL_REQUIREMENTS,
author='Fidelity International',
test_suite='test_settings.run',
tests_require=TEST_REQUIREMENTS,
url='http://github.com/divio/djangocms-version-locking',
license='BSD',
zip_safe=False
zip_safe=False,
dependency_links=[
'http://github.com/divio/django-cms/tarball/release/4.0.x#egg=django-cms-4.0.0',
'http://github.com/divio/djangocms-versioning/tarball/master#egg=djangocms-versioning-0.0.24',
'http://github.com/divio/djangocms-text-ckeditor/tarball/support/4.0.x#egg=djangocms-text-ckeditor-4.0.0dev1',
]
)
37 changes: 37 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tox]
envlist =
flake8
isort
py{34,35,36}-dj{111,20}-sqlite-cms40
py{35,36}-dj21-sqlite-cms40

skip_missing_interpreters=True

[testenv]
deps =
-r{toxinidir}/tests/requirements.txt

dj111: Django>=1.11,<2.0
dj20: Django>=2.0,<2.1
dj21: Django>=2.1,<2.2

cms40: https://github.com/divio/django-cms/archive/release/4.0.x.zip

basepython =
py34: python3.4
py35: python3.5
py36: python3.6

commands =
{envpython} --version
{env:COMMAND:coverage} erase
{env:COMMAND:coverage} run setup.py test
{env:COMMAND:coverage} report

[testenv:flake8]
commands = flake8
basepython = python3.5

[testenv:isort]
commands = isort --recursive --check-only --diff {toxinidir}
basepython = python3.5