Skip to content

Commit e8f3a89

Browse files
authored
chore: add GitHub Actions (#58)
* chore: add GitHub Actions * chore: add deploy workflow * chore: only run actions on pull request
1 parent 0c7b59a commit e8f3a89

File tree

5 files changed

+86
-30
lines changed

5 files changed

+86
-30
lines changed

.github/workflows/deploy.yml

+26
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

+22
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

+26
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

-25
This file was deleted.

tox.ini

+12-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ envlist =
44
py{36,37,38,39-dev}
55
; requires = tox-conda
66

7+
[gh-actions]
8+
python =
9+
3.6: py36
10+
3.7: py37
11+
3.8: py38
12+
3.9: py39-dev
13+
714
[testenv]
815
passenv = *
916
setenv =
@@ -17,31 +24,31 @@ commands =
1724
pytest tests --cov-report=term-missing --cov=graphql_server {posargs}
1825

1926
[testenv:black]
20-
basepython=python3.7
27+
basepython = python3.8
2128
deps = -e.[dev]
2229
commands =
2330
black --check graphql_server tests
2431

2532
[testenv:flake8]
26-
basepython=python3.7
33+
basepython = python3.8
2734
deps = -e.[dev]
2835
commands =
2936
flake8 setup.py graphql_server tests
3037

3138
[testenv:import-order]
32-
basepython=python3.7
39+
basepython = python3.8
3340
deps = -e.[dev]
3441
commands =
3542
isort -rc graphql_server/ tests/
3643

3744
[testenv:mypy]
38-
basepython=python3.7
45+
basepython = python3.8
3946
deps = -e.[dev]
4047
commands =
4148
mypy graphql_server tests --ignore-missing-imports
4249

4350
[testenv:manifest]
44-
basepython = python3.7
51+
basepython = python3.8
4552
deps = -e.[dev]
4653
commands =
4754
check-manifest -v

0 commit comments

Comments
 (0)