Cache pip, remove pypy, add pages stage

parent 20ea2f0c
Pipeline #1600 failed with stages
in 3 minutes and 29 seconds
# Setup some variables and caches
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
cache:
paths:
- "$CI_PROJECT_DIR/pip-cache"
key: "$CI_PROJECT_ID"
# Declare the stages
stages: stages:
- prepare
- lint - lint
- test - test
- build - build
- deploy - deploy
# PREPARE stage
prepare:
stage: prepare
image: python:3.5
script:
- pip install -U pip setuptools tox detox
- pip install -r requirements.txt
- pip install -r docs/requirements.txt
# CHECK stage
setup:
image: python:3.5
stage: lint
script: tox -e setup
safety:
image: python:3.5
stage: lint
script: tox -e safety
style:
image: python:3.5
stage: lint
script: tox -e style
allow_failure: true
docs:
image: python:3.5
stage: lint
before_script:
- apt-get update && apt-get install -y python-enchant
script: tox -e docs
allow_failure: true
# TEST stage
py34-django111: py34-django111:
image: python:3.4 image: python:3.4
stage: test stage: test
before_script:
- pip install tox
script: tox -e py34-django111 script: tox -e py34-django111
artifacts:
paths:
- .coverage.*
py35-django111: py35-django111:
image: python:3.5 image: python:3.5
stage: test stage: test
before_script:
- pip install tox
script: tox -e py35-django111 script: tox -e py35-django111
py36-django111: py36-django111:
image: python:3.6 image: python:3.6
stage: test stage: test
before_script:
- pip install tox
script: tox -e py36-django111 script: tox -e py36-django111
py37-django111: py37-django111:
image: python:3.7-rc-stretch image: python:3.7-rc-stretch
stage: test stage: test
before_script:
- pip install tox
script: tox -e py37-dev-django111 script: tox -e py37-dev-django111
py34-django20: py34-django20:
image: python:3.4 image: python:3.4
stage: test stage: test
before_script:
- pip install tox
script: tox -e py34-django20 script: tox -e py34-django20
py35-django20: py35-django20:
image: python:3.5 image: python:3.5
stage: test stage: test
before_script:
- pip install tox
script: tox -e py35-django20 script: tox -e py35-django20
py36-django20: py36-django20:
image: python:3.6 image: python:3.6
stage: test stage: test
before_script:
- pip install tox
script: tox -e py36-django20 script: tox -e py36-django20
py37-django20: py37-django20:
image: python:3.7-rc-stretch image: python:3.7-rc-stretch
stage: test stage: test
before_script:
- pip install tox
script: tox -e py37-dev-django20 script: tox -e py37-dev-django20
# BUILD stage
setup:
image: python:3.5
stage: lint
before_script:
- pip install tox
script: tox -e setup
safety:
image: python:3.5
stage: lint
before_script:
- pip install tox
script: tox -e safety
style:
image: python:3.5
stage: lint
before_script:
- pip install tox
script: tox -e style
allow_failure: true
docs:
image: python:3.5
stage: lint
before_script:
- apt-get update && apt-get install -y python-enchant
- pip install tox
script: tox -e docs
allow_failure: true
build: build:
image: docker:latest image: docker:latest
services: services:
...@@ -100,6 +101,7 @@ build: ...@@ -100,6 +101,7 @@ build:
stage: build stage: build
script: echo "Build Docker images" script: echo "Build Docker images"
# DEPLOY stage
deploy_staging: deploy_staging:
stage: deploy stage: deploy
script: script:
...@@ -120,3 +122,25 @@ deploy_prod: ...@@ -120,3 +122,25 @@ deploy_prod:
when: manual when: manual
only: only:
- master - master
pages:
stage: deploy
dependencies:
- py34-django111
- py35-django111
- py36-django111
- py37-django111
- py34-django20
- py35-django20
- py36-django20
- py37-django20
before_script:
- tox -e report
script:
- mv htmlcov/ public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
[tox] [tox]
envlist = envlist =
clean,setup,safety,style,docs, clean,setup,safety,style,docs,
py34-django111,
py34-django20,
py35-django111, py35-django111,
py35-django20, py35-django20,
py36-django111, py36-django111,
py36-django20, py36-django20,
py37-dev-django111, py37-dev-django111,
py37-dev-django20, py37-dev-django20,
pypy-django111,
pypy-django20,
report report
skip_missing_interpreters = true skip_missing_interpreters = true
...@@ -18,7 +14,7 @@ skip_missing_interpreters = true ...@@ -18,7 +14,7 @@ skip_missing_interpreters = true
setenv = setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/src:{toxinidir}/tests PYTHONPATH = {toxinidir}:{toxinidir}/src:{toxinidir}/tests
PYTHONUNBUFFERED=yes PYTHONUNBUFFERED=yes
commands = {posargs:pytest --cov --cov-report=term-missing -vv runtests.py tests} commands = {posargs:pytest --cov --cov-append --cov-report=term-missing -vv runtests.py tests}
deps = deps =
django111: Django>=1.11,<1.12 django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1 django20: Django>=2.0,<2.1
...@@ -32,7 +28,7 @@ whitelist_externals = tox ...@@ -32,7 +28,7 @@ whitelist_externals = tox
[testenv:test] [testenv:test]
description = Run all the Python/Django test environments. description = Run all the Python/Django test environments.
skip_install = true skip_install = true
commands = tox -e py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20, commands = tox -e py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20
tox -e report tox -e report
[testenv:dtest] [testenv:dtest]
...@@ -40,7 +36,7 @@ description = Run all the Python/Django test environments in parallel. ...@@ -40,7 +36,7 @@ description = Run all the Python/Django test environments in parallel.
skip_install = true skip_install = true
deps = detox deps = detox
commands = commands =
detox -e py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20, detox -e py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20
tox -e report tox -e report
[testenv:detox] [testenv:detox]
...@@ -48,7 +44,7 @@ description = Run all the environments in parallel. ...@@ -48,7 +44,7 @@ description = Run all the environments in parallel.
skip_install = true skip_install = true
deps = detox deps = detox
commands = commands =
detox -e clean,setup,safety,style,docs,py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20, detox -e clean,setup,safety,style,docs,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20
tox -e report tox -e report
[testenv:check] [testenv:check]
...@@ -133,4 +129,3 @@ commands = ...@@ -133,4 +129,3 @@ commands =
coverage report coverage report
coverage xml --ignore-errors coverage xml --ignore-errors
python-codacy-coverage [] python-codacy-coverage []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment