-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathconfig.yml
157 lines (146 loc) · 4.4 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: 2.1
orbs:
snyk: snyk/[email protected]
#codecov: codecov/[email protected]
codacy: codacy/[email protected]
jobs:
build_docs:
working_directory: ~/project
docker:
- image: cimg/python:3.7
steps:
- checkout
- run:
name: Setup environment
command: |
sudo chown -R circleci:circleci /usr/local/
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install -E doc
- run:
name: Building documentation
command: |
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
python -m poetry run mkdocs gh-deploy -m "[skip ci] Deployed {sha} with MkDocs version: {version}"
test_coco_assistant:
working_directory: ~/project
docker:
- image: cimg/python:3.7
steps:
- checkout
# - restore_cache:
# key: coco-{{ .Branch }}
- run:
name: Setup environment
command: |
sudo chown -R circleci:circleci /usr/local/
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install -E test -E doc -E dev
# - save_cache:
# key: coco-{{ .Branch }}
# paths:
# - "/home/circleci/.cache/pip"
- snyk/scan:
severity-threshold: high
fail-on-issues: false
- run:
name: Runnning tests
command: |
mkdir test-results
python -m poetry run pytest --junitxml=test-results/junit.xml tests/test_coco_assistant.py
python -m poetry run coverage run tests/test_coco_assistant.py
python -m poetry run coverage report -m
python -m poetry run coverage html && python -m poetry run coverage xml
- codacy/send_report:
coverage-reports: coverage.xml
#- codecov/upload:
# file: coverage.xml
- store_test_results:
path: test-results
- store_artifacts:
path: coverage
test_deploy:
working_directory: ~/project
docker:
- image: cimg/python:3.7
steps:
- add_ssh_keys:
fingerprints:
- cf:c8:70:07:e5:ab:06:9a:da:ac:cf:fa:91:ea:8a:49
- checkout
- run:
name: Setup environment
command: |
sudo chown -R circleci:circleci /usr/local/
python -m pip install poetry
python -m poetry install -E dev
- run:
name: Build and upload to Test PyPI
command: |
python -m poetry config repositories.testpypi https://test.pypi.org/legacy/
python -m poetry publish --build -r testpypi -u ashnair1 -p $TEST_PYPI_PASSWORD
deploy:
working_directory: ~/project
docker:
- image: cimg/python:3.7
steps:
- add_ssh_keys:
fingerprints:
- cf:c8:70:07:e5:ab:06:9a:da:ac:cf:fa:91:ea:8a:49
- checkout
- run:
name: Setup environment
command: |
sudo chown -R circleci:circleci /usr/local/
python -m pip install poetry
python -m poetry install -E dev
- run:
name: Build and upload to PyPI
command: |
python -m poetry publish --build -u ashnair1 -p $PYPI_PASSWORD
workflows:
version: 2
test_and_build_docs:
jobs:
- test_coco_assistant:
filters:
branches:
only:
- master
- dev
- build_docs:
filters:
branches:
only:
- master
build_deploy:
jobs:
- test_coco_assistant:
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- build_docs:
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test_deploy:
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- deploy:
requires:
- test_coco_assistant
- build_docs
- test_deploy
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/