7
7
- image : cimg/python:3.6
8
8
resource_class : small
9
9
steps :
10
- - checkout # checkout source code to working directory
10
+ - checkout # checkout source code to working directory
11
11
- run :
12
12
name : Install Environment Dependencies
13
- command : | # install env dependencies
13
+ command : | # install env dependencies
14
14
set -e
15
15
pip install --upgrade pip
16
16
pip install -r docs/dev_requirements.txt
17
17
- run :
18
- name : Black Formatting Check # Only validation, without re-formatting
18
+ name : Black Formatting Check # Only validation, without re-formatting
19
19
command : |
20
20
black --check -t py36 .
21
21
- run :
22
- name : isort Import Ordering Check # Only validation, without re-formatting
22
+ name : isort Import Ordering Check # Only validation, without re-formatting
23
23
command : |
24
24
isort --check-only --profile black .
25
25
- run :
26
- name : Flake8 Lint Check # Uses setup.cfg for configuration
26
+ name : Flake8 Lint Check # Uses setup.cfg for configuration
27
27
command : |
28
28
flake8 . --count --statistics
29
29
- run :
@@ -38,19 +38,19 @@ jobs:
38
38
pip install --no-cache-dir dist/*.whl
39
39
- run :
40
40
name : Pytest Test Cases
41
- command : | # Run test suite, uses SCALE_TEST_API_KEY env variable
41
+ command : | # Run test suite, uses SCALE_TEST_API_KEY env variable
42
42
pytest -v
43
43
- run :
44
44
name : Twine PyPI Check
45
- command : | # Validate distribution and setup.py configuration
45
+ command : | # Validate distribution and setup.py configuration
46
46
twine check --strict dist/*
47
47
pypi_publish :
48
48
docker :
49
49
- image : cimg/python:3.6
50
50
steps :
51
- - checkout # checkout source code to working directory
51
+ - checkout # checkout source code to working directory
52
52
- run :
53
- name : Validate Tag Version # Check if the tag name matches the package version
53
+ name : Validate Tag Version # Check if the tag name matches the package version
54
54
command : |
55
55
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//')
56
56
59
59
exit 1;
60
60
fi
61
61
- run :
62
- name : Validate SDK Version Increment # Check if the version is already on PyPI
62
+ name : Validate SDK Version Increment # Check if the version is already on PyPI
63
63
command : |
64
64
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//')
65
65
@@ -71,13 +71,13 @@ jobs:
71
71
fi
72
72
- run :
73
73
name : Install Environment Dependencies
74
- command : | # install env dependencies
74
+ command : | # install env dependencies
75
75
set -e
76
76
pip install --upgrade pip
77
77
pip install twine
78
78
- run :
79
79
name : Build and Validate
80
- command : | # create whl, validate with twine
80
+ command : | # create whl, validate with twine
81
81
set -e
82
82
python setup.py sdist bdist_wheel
83
83
twine check --strict dist/*
@@ -92,12 +92,15 @@ jobs:
92
92
workflows :
93
93
build_test_publish :
94
94
jobs :
95
- - build_test
95
+ - build_test :
96
+ filters :
97
+ tags :
98
+ only : /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3]
96
99
- pypi_publish :
97
100
requires :
98
101
- build_test
99
102
filters :
100
- tags :
101
- only : /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3]
102
103
branches :
103
- ignore : /.*/ # Runs for none of the branches
104
+ ignore : /.*/ # Runs for none of the branches
105
+ tags :
106
+ only : /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3]
0 commit comments