Skip to content

Commit 1c44363

Browse files
authored
Merge pull request #1 from TTWShell/feature/circleci
Feature/circleci
2 parents bd58b40 + 3726eec commit 1c44363

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

.circleci/config.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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
6+
jobs:
7+
test-py36:
8+
docker:
9+
# specify the version you desire here
10+
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
11+
- image: circleci/python:3.6
12+
user: root
13+
14+
# Specify service dependencies here if necessary
15+
# CircleCI maintains a library of pre-built images
16+
# documented at https://circleci.com/docs/2.0/circleci-images/
17+
# - image: circleci/postgres:9.4
18+
19+
working_directory: ~/repo
20+
21+
steps:
22+
- checkout
23+
- run:
24+
name: install dependencies
25+
command: |
26+
sudo pip install flake8 pytest pytest-cov
27+
sudo pip install --editable .
28+
- run:
29+
name: use flake8 check self
30+
command: |
31+
flake8 .
32+
- run:
33+
name: run hobbit cmd
34+
command: |
35+
hobbit --echo startproject -n demo -d ~/haha -f
36+
- run:
37+
name: tree flask project
38+
command: |
39+
cd ~/haha
40+
apt-get install -y tree
41+
tree
42+
- run:
43+
name: run tests
44+
environment:
45+
FLASK_APP: demo/run.py
46+
FLASK_ENV: test
47+
command: |
48+
cd ~/haha
49+
flask db init && flask db migrate && flask db upgrade
50+
flake8 . --exclude migrations
51+
py.test --cov . --cov-report term-missing -s
52+
test-py37:
53+
docker:
54+
- image: circleci/python:3.7
55+
user: root
56+
working_directory: ~/repo
57+
steps:
58+
- checkout
59+
- run:
60+
name: install dependencies
61+
command: |
62+
sudo pip install flake8 pytest pytest-cov
63+
sudo pip install --editable .
64+
- run:
65+
name: use flake8 check self
66+
command: |
67+
flake8 .
68+
- run:
69+
name: run hobbit cmd
70+
command: |
71+
mkdir ~/haha && cd ~/haha
72+
hobbit --echo startproject -n demo -f
73+
- run:
74+
name: tree flask project
75+
command: |
76+
cd ~/haha
77+
apt-get install -y tree
78+
tree
79+
- run:
80+
name: run tests
81+
environment:
82+
FLASK_APP: demo/run.py
83+
FLASK_ENV: test
84+
command: |
85+
cd ~/haha
86+
flask db init && flask db migrate && flask db upgrade
87+
flake8 . --exclude migrations
88+
py.test --cov . --cov-report term-missing -s
89+
90+
workflows:
91+
version: 2
92+
test:
93+
jobs:
94+
- test-py36
95+
- test-py37
96+
97+

0 commit comments

Comments
 (0)