Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Commit 0429c2c

Browse files
authored
Merge pull request #13 from afoucret/circleci-tests-update
Update CircleCI config to run tests against all supported versions of Python.
2 parents 679c73a + bf27c93 commit 0429c2c

File tree

1 file changed

+41
-34
lines changed

1 file changed

+41
-34
lines changed

.circleci/config.yml

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
# Python CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-python/ for more details
4-
#
5-
version: 2
1+
---
2+
3+
version: 2.1
4+
5+
executors:
6+
python-27: {docker: [{image: 'python:2.7'}]}
7+
python-35: {docker: [{image: 'python:3.5'}]}
8+
python-36: {docker: [{image: 'python:3.6'}]}
9+
python-37: {docker: [{image: 'python:3.7'}]}
10+
611
jobs:
712
build:
8-
docker:
9-
- image: circleci/python:3.7.3
10-
13+
parameters:
14+
executor:
15+
type: executor
16+
executor: << parameters.executor >>
1117
working_directory: ~/repo
12-
1318
steps:
14-
- checkout
15-
16-
# Download and cache dependencies
17-
- restore_cache:
18-
keys:
19-
- v1-dependencies-{{ checksum "requirements.txt" }}
20-
# fallback to using the latest cache if no exact match is found
21-
- v1-dependencies-
22-
23-
- run:
24-
name: install dependencies
25-
command: |
26-
python3 -m venv venv
27-
. venv/bin/activate
28-
python setup.py install
29-
30-
- save_cache:
31-
paths:
32-
- ./venv
33-
key: v1-dependencies-{{ checksum "requirements.txt" }}
19+
- checkout
20+
- restore_cache:
21+
keys:
22+
- v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}
23+
- run:
24+
name: install dependencies
25+
command: |
26+
pip install virtualenv
27+
virtualenv venv
28+
. venv/bin/activate
29+
python setup.py install
30+
- save_cache:
31+
paths:
32+
- ./venv
33+
key: v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "requirements.txt" }}
34+
- run:
35+
name: run tests
36+
command: |
37+
. venv/bin/activate
38+
python setup.py test
3439
35-
- run:
36-
name: run tests
37-
command: |
38-
. venv/bin/activate
39-
python setup.py test
40+
workflows:
41+
run-tests:
42+
jobs:
43+
- build: {name: run-tests-python-2.7, executor: python-27}
44+
- build: {name: run-tests-python-3.5, executor: python-35}
45+
- build: {name: run-tests-python-3.6, executor: python-36}
46+
- build: {name: run-tests-python-3.7, executor: python-37}

0 commit comments

Comments
 (0)