Skip to content

Commit

Permalink
[CI/CD] Build GitHub action for linting checks (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPigeon authored Jul 25, 2022
1 parent c5206c9 commit 17c274c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parallel = true
[report]
show_missing = true
precision = 2
omit =
omit = */__init__.py
exclude_lines =
pragma: no cover
def __repr__
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is GitHub Action for linting and security check
name: CI
on:
pull_request:
branches: [master]

jobs:
checks:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
env: [security, flake8, pylint]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run check
env:
TOXENV: ${{ matrix.env }}
run: |
pip install -U tox
tox
12 changes: 5 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,29 @@ commands =
redis41: pip install redis=4.1.4
redis42: pip install redis=4.2.2
pip install .
python -m pytest --ignore=setup.py # --cov-report term --cov=scrapy_redis
python -m pytest # --cov-report term --cov=scrapy_redis

[testenv:flake8]
basepython=python3.8
basepython = python3.10
deps =
{[base]deps}
flake8 # https://github.com/tholo/pytest-flake8/issues/81
commands =
flake8 docs tests

[testenv:security]
basepython=python3.8
basepython = python3.10
deps =
bandit==1.7.3
commands =
bandit -r -c .bandit.yml src/ tests/

[testenv:pylint]
basepython=python3.8
basepython = python3.10
deps =
{[base]deps}
pylint==2.12.2
commands =
pylint setup.py docs/ src/ tests/

# TODO: build windows/linux/mac

# TODO: build docs
# TODO: build docs

0 comments on commit 17c274c

Please sign in to comment.