Skip to content

Commit f02a8eb

Browse files
authored
Merge pull request #5 from NarrativeScience/circleci-publish
add circleci config to publish on merge to master
2 parents 06e1a04 + 13646a6 commit f02a8eb

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.circleci/config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 2.1
2+
3+
orbs:
4+
ghpr: narrativescience/[email protected]
5+
6+
commands:
7+
install-deps:
8+
description: Install dependencies and initialize pre-commit hooks
9+
steps:
10+
- run:
11+
command: |
12+
pip install pre-commit tox flit
13+
pre-commit install
14+
name: Install dependencies
15+
16+
jobs:
17+
test:
18+
docker:
19+
- image: circleci/python:3.7
20+
steps:
21+
- ghpr/build-prospective-branch
22+
- install-deps
23+
- run:
24+
name: Run commit hooks
25+
command: |
26+
pre-commit run \
27+
--source "origin/${GITHUB_PR_BASE_BRANCH}" \
28+
--origin "origin/${CIRCLE_BRANCH}" \
29+
--show-diff-on-failure
30+
- run: tox
31+
- run: flit build
32+
- ghpr/post-pr-comment:
33+
comment: Tests failed!
34+
when: on_fail
35+
publish:
36+
docker:
37+
- image: circleci/python:3.7
38+
steps:
39+
- checkout
40+
- run: pip install flit
41+
- run: flit build
42+
- run: flit publish
43+
44+
workflows:
45+
pull_request:
46+
jobs:
47+
- test:
48+
filters:
49+
branches:
50+
ignore:
51+
- master
52+
publish:
53+
jobs:
54+
- publish:
55+
filters:
56+
tags:
57+
only: /v[0-9]+(\.[0-9]+)*/
58+
branches:
59+
ignore: /.*/

0 commit comments

Comments
 (0)