Skip to content

Commit 17c274c

Browse files
authored
[CI/CD] Build GitHub action for linting checks (#251)
1 parent c5206c9 commit 17c274c

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

.coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parallel = true
1313
[report]
1414
show_missing = true
1515
precision = 2
16-
omit =
16+
omit = */__init__.py
1717
exclude_lines =
1818
pragma: no cover
1919
def __repr__

.github/workflows/checks.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is GitHub Action for linting and security check
2+
name: CI
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
checks:
9+
runs-on: ubuntu-18.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.10"]
14+
env: [security, flake8, pylint]
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Run check
25+
env:
26+
TOXENV: ${{ matrix.env }}
27+
run: |
28+
pip install -U tox
29+
tox

tox.ini

+5-7
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,29 @@ commands =
2727
redis41: pip install redis=4.1.4
2828
redis42: pip install redis=4.2.2
2929
pip install .
30-
python -m pytest --ignore=setup.py # --cov-report term --cov=scrapy_redis
30+
python -m pytest # --cov-report term --cov=scrapy_redis
3131

3232
[testenv:flake8]
33-
basepython=python3.8
33+
basepython = python3.10
3434
deps =
3535
{[base]deps}
3636
flake8 # https://github.com/tholo/pytest-flake8/issues/81
3737
commands =
3838
flake8 docs tests
3939

4040
[testenv:security]
41-
basepython=python3.8
41+
basepython = python3.10
4242
deps =
4343
bandit==1.7.3
4444
commands =
4545
bandit -r -c .bandit.yml src/ tests/
4646

4747
[testenv:pylint]
48-
basepython=python3.8
48+
basepython = python3.10
4949
deps =
5050
{[base]deps}
5151
pylint==2.12.2
5252
commands =
5353
pylint setup.py docs/ src/ tests/
5454

55-
# TODO: build windows/linux/mac
56-
57-
# TODO: build docs
55+
# TODO: build docs

0 commit comments

Comments
 (0)