From ee1d21936fecf04a83609e126beffe0eb265d6ea Mon Sep 17 00:00:00 2001 From: Kiran Jojare Date: Thu, 18 Jul 2024 20:42:24 -0600 Subject: [PATCH] Add CI workflow for automated builds and tests --- .github/workflows/ci.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb690cb..05cc8d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ -name: CI +name: CI Workflow -on: [push, pull_request] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: build: @@ -13,23 +17,28 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.12.2' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - - name: Run linting + - name: Run tests + run: | + python -m unittest discover test + + - name: Check code quality with flake8 run: | pip install flake8 - flake8 src/ + flake8 src test - - name: Run tests + - name: Static code analysis with pylint run: | - # Add your test command here if you have tests - echo "Tests would run here" + pip install pylint + pylint src test - - name: Check Python files + - name: Run security checks run: | - python -m compileall src/ + pip install bandit + bandit -r src test