Python linting merged or pull-requested code. #794
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: pylinting | |
run-name: Python linting merged or pull-requested code. | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
jobs: | |
do_linting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create pip requirements. | |
run: | | |
bash build/build_scripts/create_requirements.sh > requirements.txt && | |
bash build/build_scripts/create_requirements.sh all >> requirements.txt && | |
echo "pylint" >> requirements.txt | |
- name: Set up Python 3.9 . | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Install Python dependencies. | |
run: | | |
pip install -r requirements.txt | |
- name: Linting the Python source code. | |
run: | | |
pylint --output-format=colorized --rc-file .pylintrc spatialprofilingtoolbox/ | tee linter_output.txt | |
- name: Upload linter results. | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pylint-results | |
path: linter_output.txt | |
if: ${{ always() }} |