Newer
Older
# CI configuration which tests ucamlookup against supported Django and Python
# versions.
#
# GitLab CI does nto support Matrix builds in the traditional sense. Instead we
# build up a matrix of test jobs using inheritance via "extends".
#
# See also: https://gitlab.com/gitlab-org/gitlab-ce/issues/19199
include:
# Bring in the AutoDevOps template from GitLab.
# It can be viewed at:
# https://gitlab.com/gitlab-org/gitlab-ee/blob/master/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml
- template: Auto-DevOps.gitlab-ci.yml
variables:
# We use matrix testing (below) rather than the Auto-DevOps "test" job.
TEST_DISABLED: "true"
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Test code coverage
coverage:
extends: .test
variables:
TOX_ENVLIST: coverage
PYTHON_VERSION: "3.7"
# Look for the summary line output from coverage's text report. The
# parentheses are used to indicate which portion of the report contains the
# coverage percentage.
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+)%$/'
# Check for PEP8 violations
flake8:
extends: .test
variables:
TOX_ENVLIST: flake8
PYTHON_VERSION: "3.7"
# Run test suite against supported Python/Django combinations.
python27-django111:
extends: .py27
variables:
TOX_DJANGO_FRAGMENT: "django111"
python34-django111:
extends: .py34
variables:
TOX_DJANGO_FRAGMENT: "django111"
python35-django111:
extends: .py35
variables:
TOX_DJANGO_FRAGMENT: "django111"
python36-django111:
extends: .py36
variables:
TOX_DJANGO_FRAGMENT: "django111"
python37-django111:
extends: .py37
variables:
TOX_DJANGO_FRAGMENT: "django111"
python34-django20:
extends: .py34
variables:
TOX_DJANGO_FRAGMENT: "django20"
python35-django20:
extends: .py35
variables:
TOX_DJANGO_FRAGMENT: "django20"
python36-django20:
extends: .py36
variables:
TOX_DJANGO_FRAGMENT: "django20"
python37-django20:
extends: .py37
variables:
TOX_DJANGO_FRAGMENT: "django20"
python35-django21:
extends: .py35
variables:
TOX_DJANGO_FRAGMENT: "django21"
python36-django21:
extends: .py36
variables:
TOX_DJANGO_FRAGMENT: "django21"
python37-django21:
extends: .py37
variables:
TOX_DJANGO_FRAGMENT: "django21"
# Template jobs which run tests in various Python versions.
.py27:
extends: .test
variables:
PYTHON_VERSION: "2.7"
TOX_PY_FRAGMENT: "py27"
.py34:
extends: .test
variables:
PYTHON_VERSION: "3.4"
TOX_PY_FRAGMENT: "py34"
.py35:
extends: .test
variables:
PYTHON_VERSION: "3.5"
TOX_PY_FRAGMENT: "py35"
.py36:
extends: .test
variables:
PYTHON_VERSION: "3.6"
TOX_PY_FRAGMENT: "py36"
.py37:
extends: .test
variables:
PYTHON_VERSION: "3.7"
TOX_PY_FRAGMENT: "py37"
# Base test template job.
.test:
image: python:${PYTHON_VERSION}
script:
- pip install tox
- tox -e ${TOX_ENVLIST}
variables:
PYTHON_VERSION: replace-with-python-version
TOX_PY_FRAGMENT: replace-with-pyXY
TOX_DJANGO_FRAGMENT: replace-with-djangoXY
TOX_ENVLIST: "$TOX_PY_FRAGMENT-$TOX_DJANGO_FRAGMENT"