Skip to content

Commit 2a71846

Browse files
committed
Switch to GitHub actions
1 parent 4f0172f commit 2a71846

File tree

2 files changed

+110
-1
lines changed

2 files changed

+110
-1
lines changed

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
10+
flake8:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/setup-python@v1
14+
- uses: actions/checkout@v1
15+
- run: python -m pip install flake8
16+
- run: flake8
17+
18+
isort:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/setup-python@v1
22+
- uses: actions/checkout@v1
23+
- run: python -m pip install isort
24+
- run: isort --check-only --diff --recursive .
25+
26+
pydocstyle:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/setup-python@v1
30+
- uses: actions/checkout@v1
31+
- run: python -m pip install pydocstyle
32+
- run: pydocstyle .
33+
34+
dist:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/setup-python@v1
38+
- run: python -m pip install --upgrade pip setuptools wheel twine readme-renderer
39+
- uses: actions/checkout@v2
40+
- run: python setup.py sdist bdist_wheel
41+
- run: python -m twine check dist/*
42+
43+
standardjs:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v1
47+
- uses: actions/setup-node@v1
48+
with:
49+
node-version: '12.x'
50+
- run: npm install -g standard
51+
- run: standard
52+
53+
docs:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/setup-python@v1
57+
- uses: actions/checkout@v1
58+
- run: sudo apt-get install -y gettext graphviz
59+
- run: python setup.py develop
60+
- run: python setup.py build_sphinx -W -b doctest -b html
61+
62+
pytest:
63+
needs:
64+
- isort
65+
- pydocstyle
66+
- standardjs
67+
- flake8
68+
strategy:
69+
matrix:
70+
python-version:
71+
- "3.6"
72+
- "3.7"
73+
- "3.8"
74+
django-version:
75+
- "2.2"
76+
- "3.0"
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Set up Python ${{ matrix.python-version }}
80+
uses: actions/setup-python@v1
81+
with:
82+
python-version: ${{ matrix.python-version }}
83+
- name: Install Chrome
84+
run: sudo apt-get install -y google-chrome-stable
85+
- name: Install Selenium
86+
run: |
87+
mkdir bin
88+
curl -O https://chromedriver.storage.googleapis.com/77.0.3865.40/chromedriver_linux64.zip
89+
unzip chromedriver_linux64.zip -d bin
90+
- uses: actions/checkout@v1
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install --upgrade pip setuptools wheel codecov
94+
pip install -e .[test]
95+
pip install django~=${{ matrix.django-version }}
96+
- name: Run tests
97+
run: PATH=$PATH:$(pwd)/bin py.test
98+
- run: codecov
99+
env:
100+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

setup.cfg

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ tests_require =
3737
pytest-django
3838
selenium
3939

40+
[options.extras_require]
41+
test =
42+
pytest
43+
pytest-cov
44+
pytest-django
45+
selenium
46+
4047
[bdist_wheel]
4148
universal = 1
4249

@@ -53,7 +60,9 @@ source-dir = docs
5360
build-dir = docs/_build
5461

5562
[tool:pytest]
56-
addopts = --cov=django_select2 --cov-report xml
63+
addopts =
64+
--cov=django_select2
65+
--tb=short
5766
DJANGO_SETTINGS_MODULE=tests.testapp.settings
5867

5968
[tox:tox]

0 commit comments

Comments
 (0)