Skip to content

Commit

Permalink
Add check for *.py files in Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvardnmbu committed Jan 26, 2024
1 parent 65ef876 commit 5ddaee7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ jobs:
# Run Pylint and Flake8 simultaneously using background tasks and redirect output to files.
- name: Run Pylint and Flake8
run: |
git ls-files '*.py' | xargs pylint > pylint.out &
flake8 --max-line-length=100 --max-complexity=10 $(git ls-files '*.py') > flake8.out &
wait
python_files=$(git ls-files '*.py')
if [[ -n "$python_files" ]]; then
echo "$python_files" | xargs pylint > pylint.out &
flake8 --max-line-length=100 --max-complexity=10 $python_files > flake8.out &
wait
fi
# Check the output files for errors and fail the pipeline if either of them is not empty.
- name: Check for errors
Expand Down

0 comments on commit 5ddaee7

Please sign in to comment.