Skip to content

Commit

Permalink
Add Circle CI integration (FidelityInternational#60)
Browse files Browse the repository at this point in the history
Contains failures but merged to ensure that the issue is not compounded.
  • Loading branch information
Aiky30 authored Feb 20, 2020
1 parent 8b03e0c commit 773e895
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 2 deletions.
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',
]
)
4 changes: 4 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# test libraries
coverage
pyflakes>=2.1.1
flake8
isort
mock
djangocms_helper
factory-boy
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

0 comments on commit 773e895

Please sign in to comment.