-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
44 lines (41 loc) · 1.48 KB
/
.travis.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
language: python
python: "3.9"
branches:
only:
- master
- /^release-.*$/
# - develop
stages:
- env-test-build-publish
jobs:
include:
- stage: env-test-build-publish
name: "Stages: PRE-BUILDING -> TESTING -> BUILDING -> PUBLISHING to PyPI"
install:
- echo "---> Running PRE-BUILDING stage..."
- python -m pip install --upgrade pip --force-reinstall
- pip install setuptools==59.5.0 --force-reinstall
- pip install -r requirements.txt
before_script:
- export PYTHONPATH=$PYTHONPATH:$PWD:$PWD/tksbrokerapi:$PWD/tests
script:
- echo "---> Running TESTING stage..."
- pytest tests -v --disable-pytest-warnings
- echo "---> Running BUILDING stage..."
- python setup.py sdist bdist_wheel
- |
if [ $TRAVIS_PULL_REQUEST == false ]; then
echo "---> Running PUBLISHING to PyPI stage...";
python -m twine upload --verbose dist/* --skip-existing;
else
echo "---> SKIPPING PUBLISHING to PyPI stage, because this is Pull Request build";
fi
after_failure:
- echo "Some issues occurred. See full logs."
after_success:
- |
if [ $TRAVIS_PULL_REQUEST == false ]; then
echo "All stages PRE-BUILDING -> TESTING -> BUILDING -> PUBLISHING to PyPI - done";
else
echo "All PR stages PRE-BUILDING -> TESTING -> BUILDING -> [PUBLISHING to PyPI][SKIPPED] - done";
fi