Skip to content

Commit 1b22031

Browse files
authored
CircleCI: Add test runs for Python 2.7 and Python 3.5 (#161)
* Add test runs for Python 2.7 and Python 3.5 * Update Python 2.7 venv setup * Python 2.7 specific fixes for CircleCI * Moar 2.7 work-arounds * Remove venv before installing * Update job names
1 parent 1547806 commit 1b22031

File tree

1 file changed

+104
-2
lines changed

1 file changed

+104
-2
lines changed

.circleci/config.yml

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,107 @@
44
#
55
version: 2
66
jobs:
7-
build-test-python36:
7+
python27:
8+
docker:
9+
- image: circleci/python:2.7.16
10+
11+
# Specify service dependencies here if necessary
12+
# CircleCI maintains a library of pre-built images
13+
# documented at https://circleci.com/docs/2.0/circleci-images/
14+
- image: circleci/postgres:9.6.5-alpine-ram
15+
- image: circleci/mysql:5.5.62-ram
16+
- image: circleci/redis:5.0.4
17+
- image: rabbitmq:3.5.4
18+
19+
working_directory: ~/repo
20+
21+
steps:
22+
- checkout
23+
24+
# Download and cache dependencies
25+
- restore_cache:
26+
keys:
27+
- v1-dependencies-{{ checksum "requirements.txt" }}
28+
# fallback to using the latest cache if no exact match is found
29+
- v1-dependencies-
30+
31+
- run:
32+
name: install dependencies
33+
command: |
34+
rm -rf venv
35+
export PATH=/home/circleci/.local/bin:$PATH
36+
pip install --user -U pip setuptools virtualenv
37+
virtualenv --python=python2.7 --always-copy venv
38+
. venv/bin/activate
39+
pip install -U pip
40+
python setup.py install_egg_info
41+
pip install -r requirements-test.txt
42+
43+
- save_cache:
44+
paths:
45+
- ./venv
46+
key: v1-dependencies-{{ checksum "requirements.txt" }}
47+
48+
- run:
49+
name: run tests
50+
command: |
51+
. venv/bin/activate
52+
python runtests.py
53+
54+
- store_artifacts:
55+
path: test-reports
56+
destination: test-reports
57+
58+
python35:
59+
docker:
60+
- image: circleci/python:3.5.6
61+
62+
# Specify service dependencies here if necessary
63+
# CircleCI maintains a library of pre-built images
64+
# documented at https://circleci.com/docs/2.0/circleci-images/
65+
- image: circleci/postgres:9.6.5-alpine-ram
66+
- image: circleci/mysql:8.0.16
67+
- image: circleci/redis:5.0.4
68+
- image: rabbitmq:3.5.4
69+
70+
working_directory: ~/repo
71+
72+
steps:
73+
- checkout
74+
75+
# Download and cache dependencies
76+
- restore_cache:
77+
keys:
78+
- v1-dependencies-{{ checksum "requirements.txt" }}
79+
# fallback to using the latest cache if no exact match is found
80+
- v1-dependencies-
81+
82+
- run:
83+
name: install dependencies
84+
command: |
85+
python -m venv venv
86+
. venv/bin/activate
87+
pip install -U pip
88+
python setup.py install_egg_info
89+
pip install -r requirements.txt
90+
pip install -r requirements-test.txt
91+
92+
- save_cache:
93+
paths:
94+
- ./venv
95+
key: v1-dependencies-{{ checksum "requirements.txt" }}
96+
97+
- run:
98+
name: run tests
99+
command: |
100+
. venv/bin/activate
101+
python runtests.py
102+
103+
- store_artifacts:
104+
path: test-reports
105+
destination: test-reports
106+
107+
python36:
8108
docker:
9109
- image: circleci/python:3.6.8
10110

@@ -56,4 +156,6 @@ workflows:
56156
version: 2
57157
build:
58158
jobs:
59-
- build-test-python36
159+
- python27
160+
- python35
161+
- python36

0 commit comments

Comments
 (0)