diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bad52e4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Philea CI Pipeline + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +jobs: + ci: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run Linter (Flake8) + run: | + # Stop the build if there are Python syntax errors or undefined names + flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Syntax Compile Check (Build) + run: | + python -m compileall src/ + + - name: Run Unit Tests + env: + GEMINI_API_KEY: "dummy_key" + run: | + PYTHONPATH=src python -m unittest discover -s src/tests diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..22c9327 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +requests>=2.31.0 +beautifulsoup4>=4.12.0 +google-genai>=2.0.0 +pydantic>=2.0.0 +flake8>=7.0.0