Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/python-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Python Checks

on:
pull_request:
push:

jobs:
python-checks:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip

if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi

pip install pylint ruff black bandit pytype pandas

- name: Run Pylint
id: pylint
continue-on-error: true
run: |
python_files=$(find . -name "*.py" -not -path "./.venv/*")
python -m pylint $python_files

- name: Run Ruff
id: ruff
continue-on-error: true
run: |
python -m ruff check .

- name: Run Black
id: black
continue-on-error: true
run: |
python -m black --check --diff --color .

- name: Run Bandit
id: bandit
continue-on-error: true
run: |
python -m bandit -r . -x ./.venv

- name: Run Pytype
id: pytype
continue-on-error: true
run: |
python_files=$(find . -name "*.py" -not -path "./.venv/*")
python -m pytype $python_files

- name: Fail if any check failed
run: |
failed=0

if [ "${{ steps.pylint.outcome }}" != "success" ]; then
echo "Pylint failed"
failed=1
fi

if [ "${{ steps.ruff.outcome }}" != "success" ]; then
echo "Ruff failed"
failed=1
fi

if [ "${{ steps.black.outcome }}" != "success" ]; then
echo "Black failed"
failed=1
fi

if [ "${{ steps.bandit.outcome }}" != "success" ]; then
echo "Bandit failed"
failed=1
fi

if [ "${{ steps.pytype.outcome }}" != "success" ]; then
echo "Pytype failed"
failed=1
fi

exit $failed
Empty file added idk.txt
Empty file.