chore/ci: linter with reviewdog #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run linter | |
on: | |
pull_request: | |
jobs: | |
linter: | |
name: Linter | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 20 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
architecture: x64 | |
- name: Setup reviewdog | |
run: | | |
/usr/bin/sh utils/reviewdog_install.sh -b ./bin/ v0.20.3 | |
- name: Install dependencies | |
run: | | |
pip install -U pip tox wheel setuptools setuptools_scm[toml] | |
pip install .[check] | |
- name: Lint checks | |
run: | | |
flake8 py7zr tests | ./bin/reviewdog -efm="%f:%l:%c: %m" -name="flake8" -reporter=github-pr-review -level=error -fail-level=any | |
mypy py7zr | ./bin/reviewdog -f mypy -reporter=github-pr-review -level=error | |
pylint **/*.py | ./bin/reviewdog -efm="%f:%l:%c: %m" -name="pylint" -reporter=github-pr-check -fail-level=error -level=warning | |
env: | |
REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }} | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docs: | |
name: Document checks | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
architecture: x64 | |
- name: Install dependencies | |
run: | | |
pip install -U pip tox wheel setuptools setuptools_scm[toml] | |
- name: docs build and link check | |
run: | | |
tox -e docs |