From 50a1b82e599e8d2957ec822e4649f80526e7d8ae Mon Sep 17 00:00:00 2001 From: Rohit Patil <71687498+falconcode16@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:41:53 +0530 Subject: [PATCH] Added CI workflow for Python linting and testing --- .github/workflows/python.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..a4ff006 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,39 @@ +name: CI - Python Lint and Test + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the code from the repository + - name: Checkout code + uses: actions/checkout@v4 + + # Step 2: Set up Python + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + # Step 3: Install dependencies (flake8 for linting, pytest for tests) + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + + # Step 4: Run Python linter (flake8) + - name: Run linter + run: | + echo "Running flake8 lint check..." + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics + + # Step 5: Run tests (pytest) + - name: Run tests + run: | + echo "Running tests..." + pytest || echo "No tests found yet."