forked from opentensor/text-prompting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
135 lines (115 loc) · 3.45 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
version: 2.1
orbs:
python: circleci/[email protected]
jobs:
black:
resource_class: small
parameters:
python-version:
type: string
docker:
- image: cimg/python:<< parameters.python-version >>
steps:
- checkout
- restore_cache:
name: Restore cached black venv
keys:
- v1-pypi-py-black-<< parameters.python-version >>
- run:
name: Update & Activate black venv
command: |
python -m venv env/
. env/bin/activate
python -m pip install --upgrade pip
pip install black
- save_cache:
name: Save cached black venv
paths:
- "env/"
key: v1-pypi-py-black-<< parameters.python-version >>
- run:
name: Black format check
command: |
. env/bin/activate
python -m black --exclude '(env|venv|.eggs)' --check .
build-and-test:
resource_class: medium
parallelism: 2
parameters:
python-version:
type: string
docker:
- image: cimg/python:<< parameters.python-version >>
steps:
- checkout
- restore_cache:
name: Restore cached venv
keys:
- v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
- v1-pypi-py<< parameters.python-version >>
- run:
name: Update & Activate venv
command: |
python -m venv env/
. env/bin/activate
python -m pip install --upgrade pip
pip install .
- save_cache:
name: Save cached venv
paths:
- "env/"
key: v1-pypi-py<< parameters.python-version >>-{{ checksum "requirements.txt" }}
- run:
name: Install subnet1
command: |
. env/bin/activate
pip install -e .
check-version-updated:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Version is updated
command: |
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..main | grep openminers/__init__.py | wc -l) == 1 ]] && echo "openminers/__init__.py has changed"
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..main | grep VERSION | wc -l) == 1 ]] && echo "VERSION has changed"
check-changelog-updated:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: File CHANGELOG.md is updated
command: |
[[ $(git diff-tree --no-commit-id --name-only -r HEAD..main | grep CHANGELOG.md | wc -l) == 1 ]] && echo "CHANGELOG.md has changed"
check-version-not-released:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Git tag does not exist for the current version
command: |
[[ $(git tag | grep `cat VERSION` | wc -l) == 0 ]] && echo "VERSION is not a tag"
workflows:
pr-requirements:
jobs:
- black:
python-version: "3.8.12"
- build-and-test:
matrix:
parameters:
python-version: ["3.8.14", "3.9.13", "3.10.6"]
release-branches-requirements:
jobs:
- check-version-updated:
filters:
branches:
only:
- /^(release|hotfix)/.*/
- check-changelog-updated:
filters:
branches:
only:
- /^(release|hotfix)/.*/