Skip to content

Commit fa90459

Browse files
authored
chore: add GitHub Actions (#124)
1 parent 8fc378d commit fa90459

File tree

5 files changed

+86
-43
lines changed

5 files changed

+86
-43
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 🚀 Deploy to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8
18+
- name: Build wheel and source tarball
19+
run: |
20+
pip install wheel
21+
python setup.py sdist
22+
- name: Publish a Python distribution to PyPI
23+
uses: pypa/[email protected]
24+
with:
25+
user: __token__
26+
password: ${{ secrets.pypi_password }}

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python 3.8
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.8
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install tox
19+
- name: Run lint and static type checks
20+
run: tox
21+
env:
22+
TOXENV: flake8,black,import-order,mypy,manifest

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 4
10+
matrix:
11+
python-version: ["3.6", "3.7", "3.8", "3.9-dev"]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install tox tox-gh-actions
23+
- name: Test with tox
24+
run: tox
25+
env:
26+
TOXENV: ${{ matrix.toxenv }}

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

tox.ini

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
[tox]
22
envlist =
33
black,flake8,import-order,mypy,manifest,
4-
py{36,37,38,39-dev,py3}
4+
py{36,37,38,39-dev}
55

66
[pytest]
77
markers = asyncio
88

9+
[gh-actions]
10+
python =
11+
3.6: py36
12+
3.7: py37
13+
3.8: py38
14+
3.9: py39-dev
15+
916
[testenv]
1017
passenv = *
1118
setenv =
@@ -20,11 +27,11 @@ deps = -e.[test]
2027
commands =
2128
pip install -U setuptools
2229
; run "tox -- tests -s" to show output for debugging
23-
py{36,37,39-dev,py3}: pytest {posargs:tests}
30+
py{36,37,39-dev}: pytest {posargs:tests}
2431
py{38}: pytest {posargs:tests --cov-report=term-missing --cov=gql}
2532

2633
[testenv:black]
27-
basepython=python3.8
34+
basepython = python3.8
2835
deps = -e.[dev]
2936
commands =
3037
black --check gql tests
@@ -36,13 +43,13 @@ commands =
3643
flake8 gql tests
3744

3845
[testenv:import-order]
39-
basepython=python3.8
46+
basepython = python3.8
4047
deps = -e.[dev]
4148
commands =
4249
isort --recursive --check-only --diff gql tests
4350

4451
[testenv:mypy]
45-
basepython=python3.8
52+
basepython = python3.8
4653
deps = -e.[dev]
4754
commands =
4855
mypy gql tests

0 commit comments

Comments
 (0)