Skip to content

Commit

Permalink
Merge pull request #113 from Gallaecio/github-actions
Browse files Browse the repository at this point in the history
Travis CI → GitHub Actions
  • Loading branch information
wRAR committed Mar 11, 2021
2 parents 0c47a64 + b9506ce commit ffb931c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 25 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish
on: [push]

jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3

- name: Check Tag
id: check-release-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then
echo ::set-output name=release_tag::true
fi
- name: Publish to PyPI
if: steps.check-release-tag.outputs.release_tag == 'true'
run: |
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
twine upload dist/*
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests
on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 2.7
env:
TOXENV: py
- python-version: 3.5
env:
TOXENV: py
- python-version: 3.6
env:
TOXENV: py
- python-version: 3.7
env:
TOXENV: py

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run tests
env: ${{ matrix.env }}
run: |
pip install -U tox
tox
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, py35, py36, py37
envlist = py

[testenv]
deps=
Expand Down

0 comments on commit ffb931c

Please sign in to comment.