Skip to content

Commit d5be38c

Browse files
authored
test on python 2 & 3
1 parent 6ddae51 commit d5be38c

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

.circleci/config.yml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
version: 2
66
jobs:
7-
build:
7+
build_3:
88
docker:
99
# specify the version you desire here
1010
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
@@ -53,3 +53,60 @@ jobs:
5353
- store_artifacts:
5454
path: test-reports
5555
destination: test-reports
56+
57+
build_2:
58+
docker:
59+
# specify the version you desire here
60+
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
61+
- image: circleci/python:2.7
62+
63+
# Specify service dependencies here if necessary
64+
# CircleCI maintains a library of pre-built images
65+
# documented at https://circleci.com/docs/2.0/circleci-images/
66+
# - image: circleci/postgres:9.4
67+
68+
working_directory: ~/repo
69+
70+
steps:
71+
- checkout
72+
73+
# Download and cache dependencies
74+
- restore_cache:
75+
keys:
76+
- v1-dependencies-{{ checksum "requirements.txt" }}
77+
# fallback to using the latest cache if no exact match is found
78+
- v1-dependencies-
79+
80+
- run:
81+
name: install dependencies
82+
command: |
83+
python3 -m venv venv
84+
. venv/bin/activate
85+
pip install -r requirements.txt
86+
87+
- save_cache:
88+
paths:
89+
- ./venv
90+
key: v1-dependencies-{{ checksum "requirements.txt" }}
91+
92+
# run tests!
93+
# this example uses Django's built-in test-runner
94+
# other common Python testing frameworks include pytest and nose
95+
# https://pytest.org
96+
# https://nose.readthedocs.io
97+
- run:
98+
name: run tests
99+
command: |
100+
. venv/bin/activate
101+
python -m unittest discover -s ./tests
102+
103+
- store_artifacts:
104+
path: test-reports
105+
destination: test-reports
106+
107+
workflows:
108+
version: 2
109+
python_versions:
110+
jobs:
111+
- build_3
112+
- build_2

0 commit comments

Comments
 (0)