Skip to content

Commit cba727c

Browse files
authored
Move from travis to github actions (#316)
* move from travis to github actions * add flake8 to tox * add flake8 as env in tox * add flake8 to setup * remove sqlalchemy 1.1 in tests * fix flake8 exclude * move coveralls to github action * fix coverall github action config * move coveralls to tox * move coveralls dep to test list * add coverage command * move coveralls back into github action * modify coverage output
1 parent 20ecaea commit cba727c

File tree

6 files changed

+111
-52
lines changed

6 files changed

+111
-52
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.9
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.9
18+
- name: Build wheel and source tarball
19+
run: |
20+
pip install wheel
21+
python setup.py sdist bdist_wheel
22+
- name: Publish a Python distribution to PyPI
23+
uses: pypa/[email protected]
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/lint.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [push, 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.9
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.9
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install tox
19+
- name: Run lint 💅
20+
run: tox
21+
env:
22+
TOXENV: flake8

.github/workflows/tests.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 10
10+
matrix:
11+
sql-alchemy: ["1.2", "1.3"]
12+
python-version: ["3.6", "3.7", "3.8", "3.9"]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox tox-gh-actions
24+
- name: Test with tox
25+
run: tox
26+
env:
27+
SQLALCHEMY: ${{ matrix.sql-alchemy }}
28+
TOXENV: ${{ matrix.toxenv }}
29+
- name: Upload coverage.xml
30+
if: ${{ matrix.sql-alchemy == '1.3' && matrix.python-version == '3.9' }}
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: graphene-sqlalchemy-coverage
34+
path: coverage.xml
35+
if-no-files-found: error
36+
- name: Upload coverage.xml to codecov
37+
if: ${{ matrix.sql-alchemy == '1.3' && matrix.python-version == '3.9' }}
38+
uses: codecov/codecov-action@v1

.travis.yml

-47
This file was deleted.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
extras_require={
6161
"dev": [
6262
"tox==3.7.0", # Should be kept in sync with tox.ini
63-
"coveralls==1.10.0",
6463
"pre-commit==1.14.4",
64+
"flake8==3.7.9",
6565
],
6666
"test": tests_require,
6767
},

tox.ini

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
[tox]
2-
envlist = pre-commit,py{27,35,36,37}-sql{11,12,13}
2+
envlist = pre-commit,py{27,35,36,37,38,39}-sql{12,13},flake8
33
skipsdist = true
44
minversion = 3.7.0
55

6+
[gh-actions]
7+
python =
8+
2.7: py27
9+
3.5: py35
10+
3.6: py36
11+
3.7: py37
12+
3.8: py38
13+
3.9: py39
14+
15+
[gh-actions:env]
16+
SQLALCHEMY =
17+
1.2: sql12
18+
1.3: sql13
19+
620
[testenv]
21+
passenv = GITHUB_*
722
deps =
823
.[test]
9-
sql11: sqlalchemy>=1.1,<1.2
1024
sql12: sqlalchemy>=1.2,<1.3
1125
sql13: sqlalchemy>=1.3,<1.4
1226
commands =
13-
pytest graphene_sqlalchemy --cov=graphene_sqlalchemy {posargs}
27+
pytest graphene_sqlalchemy --cov=graphene_sqlalchemy --cov-report=term --cov-report=xml {posargs}
1428

1529
[testenv:pre-commit]
16-
basepython=python3.7
30+
basepython=python3.9
1731
deps =
1832
.[dev]
1933
commands =
2034
pre-commit {posargs:run --all-files}
35+
36+
[testenv:flake8]
37+
basepython = python3.9
38+
deps = -e.[dev]
39+
commands =
40+
flake8 --exclude setup.py,docs,examples,tests,.tox --max-line-length 120

0 commit comments

Comments
 (0)