diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9f163ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -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}} diff --git a/setup.cfg b/setup.cfg index 69437a0..7c3047f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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]