Switch to GitHub actions

This commit is contained in:
Johannes Hoppe 2019-12-13 14:50:15 +01:00
parent d63f410bca
commit 9e916614dc
2 changed files with 109 additions and 2 deletions

98
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,98 @@
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v1
- run: python -m pip install flake8
- run: flake8
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v1
- run: python -m pip install isort
- run: isort --check-only --diff --recursive .
pydocstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v1
- run: python -m pip install pydocstyle
- run: pydocstyle .
black:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v1
- run: python -m pip install black
- run: black --check --diff .
standardjs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install -g standard
- run: standard
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/checkout@v1
- run: sudo apt-get install -y gettext aspell libenchant-dev graphviz
- run: python setup.py develop
- run: python setup.py build_sphinx -W -b doctest -b html
pytest:
needs:
- isort
- pydocstyle
- standardjs
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
django-version:
- "2.2"
- "3.0"
runs-on: ubuntu-latest
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Chrome
run: sudo apt-get install -y google-chrome-stable
- name: Install Selenium
run: |
mkdir bin
curl -O https://chromedriver.storage.googleapis.com/77.0.3865.40/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d bin
- uses: actions/checkout@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel codecov
pip install -e .[test]
pip install django~=${{ matrix.django-version }}
- name: Run tests
run: PATH=$PATH:$(pwd)/bin py.test
- run: codecov
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

View file

@ -21,7 +21,7 @@ classifier =
include_package_data = True
packages = django_select2
install_requires =
django>=2.0
django>=2.2
django-appconf>=0.6.0
setup_requires =
setuptools_scm
@ -33,6 +33,13 @@ tests_require =
pytest-django
selenium
[options.extras_require]
test =
pytest
pytest-cov
pytest-django
selenium
[bdist_wheel]
universal = 1
@ -49,7 +56,9 @@ source-dir = docs
build-dir = docs/_build
[tool:pytest]
addopts = --cov=django_select2 --cov-report xml
addopts =
--cov=django_select2
--tb=short
DJANGO_SETTINGS_MODULE=tests.testapp.settings
[tox:tox]