Skip to content

Commit 93b5224

Browse files
CircleCI configuration update for build_test job (#28)
* circleci configurations
1 parent 68a89de commit 93b5224

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

.circleci/config.yml

+19-16
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ jobs:
77
- image: cimg/python:3.6
88
resource_class: small
99
steps:
10-
- checkout # checkout source code to working directory
10+
- checkout # checkout source code to working directory
1111
- run:
1212
name: Install Environment Dependencies
13-
command: | # install env dependencies
13+
command: | # install env dependencies
1414
set -e
1515
pip install --upgrade pip
1616
pip install -r docs/dev_requirements.txt
1717
- run:
18-
name: Black Formatting Check # Only validation, without re-formatting
18+
name: Black Formatting Check # Only validation, without re-formatting
1919
command: |
2020
black --check -t py36 .
2121
- run:
22-
name: isort Import Ordering Check # Only validation, without re-formatting
22+
name: isort Import Ordering Check # Only validation, without re-formatting
2323
command: |
2424
isort --check-only --profile black .
2525
- run:
26-
name: Flake8 Lint Check # Uses setup.cfg for configuration
26+
name: Flake8 Lint Check # Uses setup.cfg for configuration
2727
command: |
2828
flake8 . --count --statistics
2929
- run:
@@ -38,19 +38,19 @@ jobs:
3838
pip install --no-cache-dir dist/*.whl
3939
- run:
4040
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
4242
pytest -v
4343
- run:
4444
name: Twine PyPI Check
45-
command: | # Validate distribution and setup.py configuration
45+
command: | # Validate distribution and setup.py configuration
4646
twine check --strict dist/*
4747
pypi_publish:
4848
docker:
4949
- image: cimg/python:3.6
5050
steps:
51-
- checkout # checkout source code to working directory
51+
- checkout # checkout source code to working directory
5252
- 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
5454
command: |
5555
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//')
5656
@@ -59,7 +59,7 @@ jobs:
5959
exit 1;
6060
fi
6161
- 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
6363
command: |
6464
PKG_VERSION=$(sed -n 's/^__version__ = //p' scaleapi/_version.py | sed -e 's/^"//' -e 's/"$//')
6565
@@ -71,13 +71,13 @@ jobs:
7171
fi
7272
- run:
7373
name: Install Environment Dependencies
74-
command: | # install env dependencies
74+
command: | # install env dependencies
7575
set -e
7676
pip install --upgrade pip
7777
pip install twine
7878
- run:
7979
name: Build and Validate
80-
command: | # create whl, validate with twine
80+
command: | # create whl, validate with twine
8181
set -e
8282
python setup.py sdist bdist_wheel
8383
twine check --strict dist/*
@@ -92,12 +92,15 @@ jobs:
9292
workflows:
9393
build_test_publish:
9494
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]
9699
- pypi_publish:
97100
requires:
98101
- build_test
99102
filters:
100-
tags:
101-
only: /^v\d+\.\d+\.\d+$/ # Runs only for tags with the format [v1.2.3]
102103
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

Comments
 (0)