Skip to content

Commit 6f48e3a

Browse files
authored
Add Travis CI pipeline (#5)
* clean up build stage in travis * add test_sdist package stage to pipeline * remove skip installation from travis.yml * add 'set -ev' to travis scripts * add pypi requirement to travis.yml * check if the test works from the build stage * add artifacts to the build stage * avoid artifacts and caches Authored-by: begotxe <begona@gridscale.io>
1 parent 23ebddd commit 6f48e3a

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

.travis.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
language: python
22
os: linux
3+
34
install: skip
45
jobs:
56
include:
67
- stage: check_release_steps
7-
scripts: "./.travis/check_release_step.sh"
8+
script: "./.travis/check_release_step.sh"
89
- stage: build
9-
scripts: "./.travis/build.sh"
10-
addons:
11-
artifacts:
12-
working_dir: dist/
13-
target_paths: ${ARTIFACTS_JOB_ID}/${TRAVIS_OS_NAME}/${TRAVIS_COMMIT:0:8}
10+
script:
11+
- python setup.py sdist bdist_wheel
12+
- stage: test-install-src
13+
script:
14+
- python setup.py sdist
15+
- pip install dist/gs_api_client-$(python setup.py --version).tar.gz
16+
- stage: test-install-wheel
17+
script:
18+
- python setup.py bdist_wheel
19+
- pip install dist/gs_api_client-$(python setup.py --version)-py3-none-any.whl
20+
- stage: test_unittest
21+
script: "./.travis/test_unittest.sh"
22+
- stage: upload_to_pypi_org
23+
script: "./.travis/upload_to_apipy_org.sh"
24+

.travis/build.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

.travis/check_release_step.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
2+
set -ev
33
echo "Checking release version $(python setup.py --version)"
44

55
if git tag | grep -qE "^v$(python setup.py --version)$"; then echo "Release already exists"; exit 1; fi

.travis/test_unittest.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -ev
3+
echo "Running unittests"
4+
5+
python -m venv .venv
6+
source .venv/bin/activate
7+
python -m pip install -r dev-requirements.txt
8+
pytest
9+
10+
echo "Running unittests Done"
11+

.travis/upload_to_apipy_org.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -ev
3+
4+
echo "Uploading package to pypi.org"
5+
6+
# pip install twine
7+
# twine upload -u __token__ -p "$PYPI_ORG_TOKEN" dist/gs_api_client-*
8+
9+
echo "Upload Done"

0 commit comments

Comments
 (0)