Regression Validation Pipeline #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Regression Validation Pipeline | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| regression-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout backend repo | |
| uses: actions/checkout@v3 | |
| with: | |
| path: backend | |
| - name: Checkout QA repo | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: ucudal/reto-xmas-2025-goland-ia-qa | |
| token: ${{ secrets.GH_TOKEN }} | |
| path: qa | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Docker Compose | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install docker-compose -y | |
| - name: Set GUARDRAILS_API_KEY env file (RAGManager) | |
| working-directory: backend/RAGManager | |
| run: echo "GUARDRAILS_API_KEY=${{ secrets.GUARDRAILS_API_KEY }}" > .env | |
| - name: Set GUARDRAILS_API_KEY env file (DocsManager) | |
| working-directory: backend/DocsManager | |
| run: echo "GUARDRAILS_API_KEY=${{ secrets.GUARDRAILS_API_KEY }}" > .env | |
| - name: Set GUARDRAILS_API_KEY env file (backend) | |
| working-directory: backend | |
| run: echo "GUARDRAILS_API_KEY=${{ secrets.GUARDRAILS_API_KEY }}" > .env | |
| - name: Build and start backend app | |
| working-directory: backend | |
| run: docker-compose up -d docs-manager | |
| - name: Wait for backend to be ready | |
| run: | | |
| for i in {1..30}; do | |
| if curl -s http://localhost:8000/docs; then | |
| echo "RAGManager is up!" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "RAGManager did not start in time" && exit 1 | |
| - name: Install QA dependencies | |
| working-directory: qa | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run QA tests | |
| working-directory: qa | |
| run: | | |
| pytest --maxfail=1 --disable-warnings --junitxml=report.xml | |
| - name: Upload test report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: regression-test-report | |
| path: qa/report.xml | |
| - name: Tear down backend containers | |
| working-directory: backend | |
| run: | | |
| docker-compose down |