Skip to content

Commit 36a0deb

Browse files
authored
Initial commit
1 parent 3c1043c commit 36a0deb

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.circleci/config.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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
6+
commands:
7+
early_return_for_forked_pull_requests:
8+
description: >-
9+
If this build is from a fork, stop executing the current job and return success.
10+
This is useful to avoid steps that will fail due to missing credentials.
11+
steps:
12+
- run:
13+
name: Early return if this build is from a forked PR
14+
command: |
15+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
16+
echo "Nothing to do for forked PRs, so marking this step successful"
17+
circleci step halt
18+
fi
19+
jobs:
20+
build:
21+
docker:
22+
- image: circleci/python:3.6.1
23+
- image: redislabs/redisgears:edge
24+
25+
working_directory: ~/repo
26+
27+
steps:
28+
- checkout
29+
30+
# Download and cache dependencies
31+
- restore_cache:
32+
keys:
33+
- v1-dependencies-{{ checksum "requirements.txt" }}
34+
# fallback to using the latest cache if no exact match is found
35+
- v1-dependencies-
36+
37+
- run:
38+
name: install dependencies
39+
command: |
40+
python -m venv venv
41+
. venv/bin/activate
42+
pip install -r requirements.txt
43+
pip install codecov
44+
45+
- save_cache:
46+
paths:
47+
- ./venv
48+
key: v1-dependencies-{{ checksum "requirements.txt" }}
49+
50+
- run:
51+
name: test dist
52+
command: python setup.py sdist
53+
54+
- run:
55+
name: run tests
56+
command: |
57+
. venv/bin/activate
58+
coverage run test.py
59+
60+
- early_return_for_forked_pull_requests
61+
62+
- run:
63+
name: codecove
64+
command: |
65+
. venv/bin/activate
66+
codecov
67+
68+
# - store_artifacts:
69+
# path: test-reports
70+
# destination: test-reports
71+
72+
workflows:
73+
version: 2
74+
commit:
75+
jobs:
76+
- build
77+
nightly:
78+
triggers:
79+
- schedule:
80+
cron: "0 0 * * *"
81+
filters:
82+
branches:
83+
only:
84+
- master
85+
jobs:
86+
- build

0 commit comments

Comments
 (0)