Skip to content

chore: add GitHub Actions #58

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

Merged
merged 3 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
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
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/gh-action-pypi-publish@v1.1.0
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