Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Travis pipeline #961

Merged
merged 3 commits into from
Aug 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 54 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
stages:
- name: "lint"
- name: "test"
- name: "deploy-github"
if: "tag IS present"
- name: "deploy-pypi"
if: "tag IS present"

language: "python"
dist: "xenial"
os: "linux"
Expand All @@ -8,30 +16,53 @@ python:
- "3.7"
- "3.8"

install:
- "pip install virtualenv"
- "virtualenv .venv"
- ".venv/bin/pip install pip setuptools -U"
- ".venv/bin/pip install tox"
# --------------------------------------------------------------------------
# Tests
# --------------------------------------------------------------------------
before_script:
- "pip install --upgrade pip"
- "pip install poetry"
- "poetry install"
script:
- "poetry run tox -e py36,py37,py38"


jobs:
include:
- stage: "lint"
script: ".venv/bin/tox -e black"
- script: ".venv/bin/tox -e flake8"
- script: ".venv/bin/tox -e yamllint"

stages:
- "lint"
- "test"

script:
- ".venv/bin/tox -e py36,py37,py38"

deploy:
provider: "script"
script:
- "poetry config pypi-token.pypi $PYPI_TOKEN"
- "poetry publish --build"
on:
tags: true
before_script:
- "pip install --upgrade pip"
- "pip install poetry"
- "poetry install"
script:
- "poetry run tox -e black"
- "poetry run tox -e flake8"
- "poetry run tox -e yamllint"
- stage: "deploy-github"
before_script:
- "pip install --upgrade pip"
- "pip install poetry"
script:
- "poetry version $TRAVIS_TAG"
- "poetry build"
deploy:
provider: "releases"
api_key: "$GITHUB_AUTH_TOKEN"
file_glob: true
file: "dist/*"
skip_cleanup: true
"on":
all_branches: true
- stage: "deploy-pypi"
before_script:
- "pip install --upgrade pip"
- "pip install poetry"
script:
- "echo Deploying the release to PyPI"
- "poetry version $TRAVIS_TAG"
deploy:
provider: "script"
skip_cleanup: true
script: "poetry publish --build -u __token__ -p $PYPI_TOKEN"
"on":
all_branches: true