Skip to content

Commit f47a941

Browse files
authored
Integrating CircleCI with platform usage. (#29)
Integrating CircleCI with platform usage.
2 parents d287378 + 13f4421 commit f47a941

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.circleci/config.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
build:
8+
docker:
9+
- image: circleci/mysql:5.7
10+
working_directory: /root/singnet
11+
environment:
12+
PYTHONPATH: /root/singnet/snet-platform-usage
13+
steps:
14+
- checkout
15+
- restore_cache:
16+
keys:
17+
- v1-dependencies-{{ checksum "metering/requirements.txt" }}
18+
# fallback to using the latest cache if no exact match is found
19+
- v1-dependencies-
20+
- run:
21+
name: Install Python and Git
22+
command: |
23+
mysql --version
24+
service mysql start
25+
apt-get update
26+
apt-get -y install sudo wget git
27+
apt-get -y install python3 python3-pip
28+
- run:
29+
name: install dependencies
30+
command: |
31+
python3 -m venv venv
32+
. venv/bin/activate
33+
pip install -r metering/requirements.txt
34+
35+
- save_cache:
36+
paths:
37+
- ./venv
38+
key: v1-dependencies-{{ checksum "requirements.txt" }}
39+
# run tests!
40+
# this example uses Django's built-in test-runner
41+
# other common Python testing frameworks include pytest and nose
42+
# https://pytest.org
43+
# https://nose.readthedocs.io
44+
- run:
45+
name: run tests
46+
command: |
47+
. venv/bin/activate
48+
python metering/tests/test_total_calls.py test
49+
- store_artifacts:
50+
path: test-reports
51+
destination: test-reports

0 commit comments

Comments
 (0)