Skip to content

Commit

Permalink
chore: add GitHub Actions (#58)
Browse files Browse the repository at this point in the history
* chore: add GitHub Actions

* chore: add deploy workflow

* chore: only run actions on pull request
  • Loading branch information
KingDarBoja authored Jul 23, 2020
1 parent 0c7b59a commit e8f3a89
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 30 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🚀 Deploy to PyPI

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build wheel and source tarball
run: |
pip install wheel
python setup.py sdist
- name: Publish a Python distribution to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run lint and static type checks
run: tox
env:
TOXENV: flake8,black,import-order,mypy,manifest
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9-dev"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
env:
TOXENV: ${{ matrix.toxenv }}
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

17 changes: 12 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ envlist =
py{36,37,38,39-dev}
; requires = tox-conda

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39-dev

[testenv]
passenv = *
setenv =
Expand All @@ -17,31 +24,31 @@ commands =
pytest tests --cov-report=term-missing --cov=graphql_server {posargs}

[testenv:black]
basepython=python3.7
basepython = python3.8
deps = -e.[dev]
commands =
black --check graphql_server tests

[testenv:flake8]
basepython=python3.7
basepython = python3.8
deps = -e.[dev]
commands =
flake8 setup.py graphql_server tests

[testenv:import-order]
basepython=python3.7
basepython = python3.8
deps = -e.[dev]
commands =
isort -rc graphql_server/ tests/

[testenv:mypy]
basepython=python3.7
basepython = python3.8
deps = -e.[dev]
commands =
mypy graphql_server tests --ignore-missing-imports

[testenv:manifest]
basepython = python3.7
basepython = python3.8
deps = -e.[dev]
commands =
check-manifest -v

0 comments on commit e8f3a89

Please sign in to comment.