forked from rootstrap/django-drip-campaigns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·134 lines (125 loc) · 4.4 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
132
133
134
language: python
cache: pip
dist: xenial
# This Python and Django versions will be used only by the Test Reporter stage
python:
- "3.8"
env:
- jobs:
- DJANGO_VERSION="3.1.7"
- global:
- CC_TEST_REPORTER_ID
#--------------------------------------------------------------------
install:
- pip3 install "Django==${DJANGO_VERSION}"
- pip3 install flake8
- pip3 install coverage
script:
# makemigrations of each app is needed
- python manage.py makemigrations drip
- python manage.py makemigrations credits
- python manage.py makemigrations auth
- python manage.py migrate
- flake8 .
- coverage run manage.py test
jobs:
include:
# Test combinations: From Python 3.5 to pypy3 combining with Django 2.2 and 3.1.7.
# Excluding: Python 3.5 and Django 3.1.7 because they are no compatible.
# Also excluding: Python 3.8 and Django 3.1.7 because they are used in Test Reporter.
# Test stage is executed if it is not a docs PR.
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.5"
env:
- DJANGO_VERSION="2.2"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.6"
env:
- DJANGO_VERSION="2.2"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.6"
env:
- DJANGO_VERSION="3.1.7"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.7"
env:
- DJANGO_VERSION="2.2"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.7"
env:
- DJANGO_VERSION="3.1.7"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "3.8"
env:
- DJANGO_VERSION="2.2"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "pypy3"
env:
- DJANGO_VERSION="2.2"
- stage: Test
if: NOT (branch =~ /^docs\/.*/)
python:
- "pypy3"
env:
- DJANGO_VERSION="3.1.7"
# Test Reporter
# Test and report the resultant coverage.
# Combination of Python 3.8 and Django 3.1.7. It uses from the configuration at the beggining of this file.
# Test Reporter stage is executed if it is not a docs PR.
- stage: Test Reporter
if: NOT (branch =~ /^docs\/.*/)
script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
# makemigrations of each app is needed
- python manage.py makemigrations drip
- python manage.py makemigrations credits
- python manage.py makemigrations auth
- python manage.py migrate
- flake8 .
- coverage run manage.py test
- coverage xml
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# Build docs
# Builds the docs to see that there is no error in documentation.
# Build docs stage is executed only on docs PR.
- stage: Build docs
if: branch =~ /^docs\/.*/
python:
- "3.8"
env:
- DJANGO_VERSION="3.1.7"
script:
- pip3 install Sphinx
- pip3 install sphinxcontrib-django
- pip3 install sphinx-rtd-theme
- sphinx-build -b html docs/source/ build/
- sudo rm -r build/
# Publish on Pypi
# Publish the master branch in Pypi.
# Publish on Pypi stage is executed when merging on master branch and it is not a docs PR.
- stage: Publish on Pypi
if: NOT (commit_message =~ /^Merge pull request .*docs\/.*/) AND (branch = master)
python:
- "3.8"
script: skip
deploy:
provider: pypi
username: "__token__"
password:
secure: "W+dg4Ho478+F90rgOHxJu3uz2EjtfS1aUZkLo0pJIxtAsGjpMytcBK41OpxDJ9QcBpq9btKXH/L5Y7OAfSsMX2MSVIr6bwxfOvG2704KVtBFGxbMxiNXmWdfBn9Bp8ccB0NHdUZiyI0nbLwlb8tpHKPv/I5KfdgIv30gf/MXrvAygo6LrDk2OZP0ihRJAb1viFyfFH8t3kwv3tDINEqZC7G+9OMPJBgiBaWE/3yS9AV8te53yfS54AXRXIrwgPmMXsV5zylg2vtKyS+I2qMN217sy11B057uw6AfH/k8rL6xsbssielT4IegYpbe8NsU7etKbU6s+XZu/pyn7XpDLzmLQ+1HfoH9F5B32Osv18j70lqRnjU8kXjz+EEJWy9zWZ1QBGWB4SQX5uHOARttELchHF6lE1TUjBUDiFDc9MYo+7ipSC+kn3h+hAZPi5nIt4dmaf7pddNM6ba01DT/TP0AVs4m1EJamONUPNd/vPcuxj5Pu575GYvsDFu4HYtKvf1MR9P8QoZkGU/XGcC86oz2iSvRQJqaK2EAe+p8D4LOmkWxLdFRD/SQKj7g/Ymwlg5N/ffg3JyNfOrBCxldiihae92QMMiryw067oIYu/yA++I5nbq/3OodZmezlAZu/F3jAIwt1o3I8KgkvJVGj3bTRW6Nfl1lwznwyYTdOVE="