mirror of
https://github.com/django/daphne.git
synced 2025-07-10 16:02:18 +03:00
Add GitHub Actions
This commit is contained in:
parent
d0e841b41d
commit
93849fadad
47
.github/workflows/tests.yml
vendored
Normal file
47
.github/workflows/tests.yml
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version:
|
||||||
|
- 3.6
|
||||||
|
- 3.7
|
||||||
|
- 3.8
|
||||||
|
- 3.9
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip wheel setuptools tox
|
||||||
|
- name: Run tox targets for ${{ matrix.python-version }}
|
||||||
|
run: |
|
||||||
|
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
|
||||||
|
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip tox
|
||||||
|
- name: Run lint
|
||||||
|
run: tox -e qa
|
|
@ -127,8 +127,8 @@ class DaphneProcess(multiprocessing.Process):
|
||||||
|
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
|
|
||||||
from .server import Server
|
|
||||||
from .endpoints import build_endpoint_description_strings
|
from .endpoints import build_endpoint_description_strings
|
||||||
|
from .server import Server
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create the server class
|
# Create the server class
|
||||||
|
@ -266,8 +266,8 @@ class TestApplication:
|
||||||
|
|
||||||
|
|
||||||
def _reinstall_reactor():
|
def _reinstall_reactor():
|
||||||
import sys
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import sys
|
||||||
|
|
||||||
from twisted.internet import asyncioreactor
|
from twisted.internet import asyncioreactor
|
||||||
|
|
||||||
|
|
21
setup.cfg
21
setup.cfg
|
@ -1,16 +1,11 @@
|
||||||
[bdist_wheel]
|
|
||||||
universal=1
|
|
||||||
|
|
||||||
[tool:pytest]
|
|
||||||
addopts = tests/
|
|
||||||
|
|
||||||
[isort]
|
|
||||||
include_trailing_comma = True
|
|
||||||
multi_line_output = 3
|
|
||||||
known_first_party = channels,daphne,asgiref,channels_redis
|
|
||||||
line_length = 88
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = venv/*,tox/*,docs/*,testproject/*,js_client/*,.eggs/*
|
exclude = venv/*,tox/*,docs/*,testproject/*,js_client/*,.eggs/*
|
||||||
ignore = E123,E128,E266,E402,W503,E731,W601
|
extend-ignore = E123, E128, E266, E402, W503, E731, W601
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
|
||||||
|
[isort]
|
||||||
|
profile = black
|
||||||
|
known_first_party = channels,daphne,asgiref,channels_redis,http_base,http_strategies
|
||||||
|
|
||||||
|
[tool:pytest]
|
||||||
|
testpaths = tests
|
||||||
|
|
23
tox.ini
Normal file
23
tox.ini
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[tox]
|
||||||
|
envlist =
|
||||||
|
py{36,37,38,39}-twisted{187,latest}
|
||||||
|
qa
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
usedevelop = true
|
||||||
|
extras = tests
|
||||||
|
commands =
|
||||||
|
pytest -v {posargs}
|
||||||
|
deps =
|
||||||
|
twisted187: twisted==18.7.0
|
||||||
|
twistedlatest: twisted>=20.3.0
|
||||||
|
|
||||||
|
[testenv:qa]
|
||||||
|
deps =
|
||||||
|
black
|
||||||
|
flake8
|
||||||
|
isort
|
||||||
|
commands =
|
||||||
|
flake8 daphne tests
|
||||||
|
black --check daphne tests
|
||||||
|
isort --check-only --diff daphne tests
|
Loading…
Reference in New Issue
Block a user