Add linting and docs to GitHub Actions CI
This commit is contained in:
committed by
Seth Michael Larson
parent
2704580f7b
commit
3a89b7bd01
@@ -0,0 +1,55 @@
|
||||
---
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v1
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3.7 -m pip install setuptools wheel twine
|
||||
- name: Build packages
|
||||
run: |
|
||||
python3.7 setup.py sdist bdist_wheel
|
||||
- name: Check packages
|
||||
run: |
|
||||
set -exo pipefail;
|
||||
if [ $(python3.7 -m twine check dist/* | grep -c 'warning') != 0 ]; then exit 1; fi
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v1
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3.7 -m pip install tox
|
||||
- name: Lint the code
|
||||
run: tox -e lint
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v1
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3.7 -m pip install tox
|
||||
- name: Build the docs
|
||||
run: tox -e docs
|
||||
@@ -8,3 +8,6 @@ universal = 1
|
||||
|
||||
[bdist_rpm]
|
||||
requires = python python-urllib3
|
||||
|
||||
[flake8]
|
||||
ignore = E203, E266, E501, W503
|
||||
|
||||
@@ -1,8 +1,32 @@
|
||||
[tox]
|
||||
envlist = pypy,py27,py34,py35,py36,py37,py38
|
||||
envlist = pypy,py27,py34,py35,py36,py37,py38,lint,docs
|
||||
[testenv]
|
||||
whitelist_externals = git
|
||||
setenv =
|
||||
NOSE_XUNIT_FILE = junit-{envname}.xml
|
||||
commands =
|
||||
python setup.py test
|
||||
|
||||
[testenv:lint]
|
||||
deps =
|
||||
flake8
|
||||
black
|
||||
commands =
|
||||
black --target-version=py27 \
|
||||
elasticsearch/ \
|
||||
test_elasticsearch/ \
|
||||
setup.py
|
||||
black --target-version=py27 --check \
|
||||
elasticsearch/ \
|
||||
test_elasticsearch/ \
|
||||
setup.py
|
||||
flake8 \
|
||||
elasticsearch/ \
|
||||
test_elasticsearch/
|
||||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
sphinx
|
||||
sphinx-rtd-theme
|
||||
commands =
|
||||
sphinx-build docs/ docs/_build -b html
|
||||
|
||||
Reference in New Issue
Block a user