Skip to content

Commit ea91fbc

Browse files
committed
CI adjustments
1 parent e7f34f2 commit ea91fbc

File tree

5 files changed

+114
-116
lines changed

5 files changed

+114
-116
lines changed

.github/workflows/checks.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Checks
2+
on: [push, pull_request]
3+
4+
jobs:
5+
checks:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
include:
10+
- python-version: 3.8
11+
env:
12+
TOXENV: bandit
13+
- python-version: 3.8
14+
env:
15+
TOXENV: black
16+
- python-version: 3.8
17+
env:
18+
TOXENV: flake8
19+
- python-version: 3.8
20+
env:
21+
TOXENV: typing
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Run check
32+
env: ${{ matrix.env }}
33+
run: |
34+
pip install -U pip
35+
pip install -U tox
36+
tox

.github/workflows/main.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Python 3
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3
17+
18+
- name: Publish to PyPI
19+
run: |
20+
pip install --upgrade pip
21+
pip install --upgrade setuptools wheel twine
22+
python setup.py sdist bdist_wheel
23+
export TWINE_USERNAME=__token__
24+
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
25+
twine upload dist/*

.github/workflows/tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
tests:
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, macos-10.15]
10+
python-version: [3.7, 3.8, 3.9]
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install tox
21+
run: pip install tox
22+
23+
- name: Install playwright & browsers
24+
run: |
25+
pip install playwright
26+
python -m playwright install
27+
28+
- name: Run tests
29+
run: tox -e py
30+
31+
- name: Upload coverage report
32+
run: bash <(curl -s https://codecov.io/bash)

tox.ini

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[tox]
2-
envlist = py,flake8,typing,black
3-
2+
envlist = bandit,black,flake8,typing,py
43

54
[testenv]
65
deps =
@@ -11,30 +10,40 @@ deps =
1110
pytest-cov>=2.8
1211
pytest-twisted>=1.11
1312
commands =
14-
py.test --reactor=asyncio --cov=scrapy_playwright --cov-report=term-missing --cov-report=html --cov-report=xml {posargs: scrapy_playwright tests}
13+
py.test --reactor=asyncio \
14+
--cov-report=term-missing --cov-report=html --cov-report=xml \
15+
--cov=scrapy_playwright {posargs: scrapy_playwright tests}
1516
setenv =
1617
DEBUG=pw:api
1718

1819
[testenv:py]
1920
basepython = python3
2021

21-
[testenv:flake8]
22+
[testenv:bandit]
23+
basepython = python3
24+
deps =
25+
bandit
26+
commands =
27+
bandit -r {posargs: scrapy_playwright setup.py}
28+
29+
[testenv:black]
2230
basepython = python3.8
2331
deps =
24-
flake8>=3.7.9
32+
black==20.8b1
2533
commands =
26-
flake8 --exclude=.git,.tox,venv* scrapy_playwright tests
34+
black --check {posargs: scrapy_playwright setup.py tests examples}
2735

28-
[testenv:typing]
36+
[testenv:flake8]
2937
basepython = python3.8
3038
deps =
31-
mypy==0.790
39+
flake8>=3.7.9
3240
commands =
33-
mypy --ignore-missing-imports --follow-imports=skip scrapy_playwright
41+
flake8 --exclude=.git,.tox,venv* {posargs: scrapy_playwright setup.py tests examples}
3442

35-
[testenv:black]
43+
[testenv:typing]
3644
basepython = python3.8
3745
deps =
38-
black==20.8b1
46+
mypy==0.790
3947
commands =
40-
black --check scrapy_playwright tests
48+
mypy --show-error-codes --ignore-missing-imports \
49+
--follow-imports=skip {posargs: scrapy_playwright setup.py tests}

0 commit comments

Comments
 (0)