Replace flake8 and pylint with ruff #10
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: pr-coverage-lint | |
on: | |
pull_request: | |
branches: ['*'] | |
jobs: | |
tests: | |
name: Coverage and Lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
- name: Install from source | |
run: | | |
pip install --upgrade pip setuptools wheel | |
pip install .[test] | |
- name: Install CLI Reviewdog | |
uses: reviewdog/action-setup@v1 | |
# Order is important for these commands | |
# Run the actual fixes first so that they are picked up by next GH step but | |
# removed from the final run of the linter. | |
# Second run of the linter will report unfixable issues via reviewdog | |
- name: Run Linting | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ruff format . | |
ruff check . --fix-only | |
ruff check . | reviewdog -efm="%f:%l:%c: %m" -reporter=github-pr-review -level=warning | |
# Picks up file changes from the previous action | |
- name: Suggest Fixes | |
uses: reviewdog/action-suggester@v1 | |
with: | |
tool_name: ruff | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
level: warning | |
- name: Coverage | |
run: | | |
pip install cython | |
cythonize tests/test_cython/cython_example.pyx | |
pytest --cov-report=lcov | |
- name: Report coverage | |
uses: romeovs/[email protected] | |
with: | |
filter-changed-files: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lcov-file: ./coverage.lcov |