fix(ci): use Python virtual environment for PEP 668 compliance
Some checks failed
Deploy Frontend / build-and-deploy (push) Successful in 4m2s
DSPy RAG Evaluation / Layer 1 - Unit Tests (push) Failing after 9m53s
DSPy RAG Evaluation / Layer 3 - Integration Tests (push) Has been skipped
DSPy RAG Evaluation / Layer 2 - DSPy Module Tests (push) Has been skipped
DSPy RAG Evaluation / Layer 4 - Comprehensive Evaluation (push) Has been skipped
DSPy RAG Evaluation / Quality Gate (push) Failing after 1s
Some checks failed
Deploy Frontend / build-and-deploy (push) Successful in 4m2s
DSPy RAG Evaluation / Layer 1 - Unit Tests (push) Failing after 9m53s
DSPy RAG Evaluation / Layer 3 - Integration Tests (push) Has been skipped
DSPy RAG Evaluation / Layer 2 - DSPy Module Tests (push) Has been skipped
DSPy RAG Evaluation / Layer 4 - Comprehensive Evaluation (push) Has been skipped
DSPy RAG Evaluation / Quality Gate (push) Failing after 1s
- Create venv at /opt/venv in each job - Source venv/bin/activate before pip install and pytest commands - Add python3-full package for complete venv support - Fixes 'externally-managed-environment' error on Debian Bookworm
This commit is contained in:
parent
c5fb9ec88e
commit
38db05656a
1 changed files with 41 additions and 31 deletions
|
|
@ -41,6 +41,7 @@ on:
|
|||
env:
|
||||
SERVER_IP: '91.98.224.44'
|
||||
SERVER_USER: 'root'
|
||||
VENV_PATH: '/opt/venv'
|
||||
|
||||
jobs:
|
||||
# ==========================================================================
|
||||
|
|
@ -49,27 +50,30 @@ jobs:
|
|||
unit-tests:
|
||||
name: Layer 1 - Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
# Note: No container block - use default node:20-bookworm with Python installed via apt
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Install Python
|
||||
- name: Setup Python with virtual environment
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y python3 python3-pip python3-venv
|
||||
python3 --version
|
||||
apt-get install -y python3 python3-pip python3-venv python3-full
|
||||
python3 -m venv ${{ env.VENV_PATH }}
|
||||
echo "Python version: $(python3 --version)"
|
||||
echo "Venv created at ${{ env.VENV_PATH }}"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -e ".[dev]"
|
||||
python3 -m pip install rapidfuzz
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
pip install rapidfuzz
|
||||
|
||||
- name: Run Layer 1 unit tests
|
||||
run: |
|
||||
python3 -m pytest tests/dspy_gitops/test_layer1_unit.py \
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
python -m pytest tests/dspy_gitops/test_layer1_unit.py \
|
||||
-v --tb=short \
|
||||
--junit-xml=layer1-results.xml
|
||||
|
||||
|
|
@ -86,7 +90,6 @@ jobs:
|
|||
dspy-module-tests:
|
||||
name: Layer 2 - DSPy Module Tests
|
||||
runs-on: ubuntu-latest
|
||||
# Note: No container block - use default node:20-bookworm with Python installed via apt
|
||||
timeout-minutes: 20
|
||||
needs: unit-tests
|
||||
|
||||
|
|
@ -96,22 +99,25 @@ jobs:
|
|||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Install Python
|
||||
- name: Setup Python with virtual environment
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y python3 python3-pip python3-venv
|
||||
apt-get install -y python3 python3-pip python3-venv python3-full
|
||||
python3 -m venv ${{ env.VENV_PATH }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -e ".[dev]"
|
||||
python3 -m pip install dspy-ai httpx rapidfuzz litellm
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
pip install dspy-ai httpx rapidfuzz litellm
|
||||
|
||||
- name: Run Layer 2 DSPy tests
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
run: |
|
||||
python3 -m pytest tests/dspy_gitops/test_layer2_dspy.py \
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
python -m pytest tests/dspy_gitops/test_layer2_dspy.py \
|
||||
-v --tb=short \
|
||||
--junit-xml=layer2-results.xml
|
||||
|
||||
|
|
@ -128,23 +134,24 @@ jobs:
|
|||
integration-tests:
|
||||
name: Layer 3 - Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
# Note: No container block - use default node:20-bookworm with Python installed via apt
|
||||
timeout-minutes: 15
|
||||
needs: unit-tests
|
||||
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
- name: Setup Python with virtual environment
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y openssh-client curl python3 python3-pip python3-venv
|
||||
apt-get install -y openssh-client curl python3 python3-pip python3-venv python3-full
|
||||
python3 -m venv ${{ env.VENV_PATH }}
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -e ".[dev]"
|
||||
python3 -m pip install httpx pytest-asyncio
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
pip install httpx pytest-asyncio
|
||||
|
||||
- name: Setup SSH for tunnel
|
||||
run: |
|
||||
|
|
@ -177,7 +184,8 @@ jobs:
|
|||
OXIGRAPH_ENDPOINT: "http://127.0.0.1:7878"
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
run: |
|
||||
python3 -m pytest tests/dspy_gitops/test_layer3_integration.py \
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
python -m pytest tests/dspy_gitops/test_layer3_integration.py \
|
||||
-v --tb=short \
|
||||
--junit-xml=layer3-results.xml
|
||||
|
||||
|
|
@ -194,7 +202,6 @@ jobs:
|
|||
comprehensive-eval:
|
||||
name: Layer 4 - Comprehensive Evaluation
|
||||
runs-on: ubuntu-latest
|
||||
# Note: No container block - use default node:20-bookworm with Python installed via apt
|
||||
timeout-minutes: 60
|
||||
needs: [unit-tests, dspy-module-tests, integration-tests]
|
||||
|
||||
|
|
@ -204,16 +211,18 @@ jobs:
|
|||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
- name: Setup Python with virtual environment
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y openssh-client curl python3 python3-pip python3-venv
|
||||
apt-get install -y openssh-client curl python3 python3-pip python3-venv python3-full
|
||||
python3 -m venv ${{ env.VENV_PATH }}
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -e ".[dev]"
|
||||
python3 -m pip install dspy-ai httpx rapidfuzz pandas pytest-json-report litellm
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
pip install dspy-ai httpx rapidfuzz pandas pytest-json-report litellm
|
||||
|
||||
- name: Setup SSH for tunnel
|
||||
run: |
|
||||
|
|
@ -235,7 +244,8 @@ jobs:
|
|||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
OXIGRAPH_ENDPOINT: "http://127.0.0.1:7878"
|
||||
run: |
|
||||
python3 -m pytest tests/dspy_gitops/test_layer4_comprehensive.py \
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
python -m pytest tests/dspy_gitops/test_layer4_comprehensive.py \
|
||||
-v --tb=short \
|
||||
--junit-xml=layer4-results.xml \
|
||||
--json-report \
|
||||
|
|
@ -243,7 +253,8 @@ jobs:
|
|||
|
||||
- name: Generate metrics summary
|
||||
run: |
|
||||
python3 -c "
|
||||
source ${{ env.VENV_PATH }}/bin/activate
|
||||
python -c "
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
|
|
@ -319,4 +330,3 @@ jobs:
|
|||
echo "============================================"
|
||||
echo " All required quality gates passed!"
|
||||
echo "============================================"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue