Skip to content

Commit

Permalink
Replace Travis with GitHub Actions (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 authored Apr 13, 2021
1 parent 5786629 commit 3739cd9
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 26 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish Python Package

on:
release:
types: [created]

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install test dependencies
uses: BSFishy/pip-action@v1
with:
packages: |
black
isort
- name: Check code with black
run: black --check .
- name: Check code with isort
run: isort --profile black . --check-only

deploy:
name: Deploy to PyPI
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install publish dependencies
uses: BSFishy/pip-action@v1
with:
packages: |
setuptools
wheel
twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Add GitHub release assets
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload workflow artifact
uses: actions/upload-artifact@v2
with:
name: vulcan-api
path: |
dist/*.whl
dist/*.tar.gz
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run tests

on:
push:
pull_request:

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install test dependencies
uses: BSFishy/pip-action@v1
with:
packages: |
black
isort
- name: Check code with black
run: black --check .
- name: Check code with isort
run: isort --profile black . --check-only
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://discord.gg/sTHCrXB"><img src="https://img.shields.io/discord/619178050562686988?color=7289DA&label=discord" alt="Discord"></a>
</p>
<p align="center">
<a href="https://travis-ci.com/kapi2289/vulcan-api"><img src="https://travis-ci.com/kapi2289/vulcan-api.svg?branch=master" alt="Tests status"></a>
<a href="https://github.com/kapi2289/vulcan-api/actions/workflows/test.yml"><img src="https://img.shields.io/github/workflow/status/kapi2289/vulcan-api/Run%20tests/master" alt="Tests status"></a>
<a href="https://vulcan-api.readthedocs.io/en/latest/?badge=latest"><img src="https://img.shields.io/readthedocs/vulcan-api.svg" alt="Documentation status"></a>
</p>
<p align="center">
Expand Down
5 changes: 0 additions & 5 deletions pytest.ini

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pytest~=6.2.3
related~=0.7.2
aenum~=3.0.0
aiohttp~=3.7.4
Expand Down

0 comments on commit 3739cd9

Please sign in to comment.