Dev branch #44
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: Python CI/CD | |
| env: | |
| GPSE_API_KEY: ArzaSdB1_DhfPRKfJMdY6dp8duWdQTKQdC2xxkwc | |
| GROQ_API_KEY: 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 | |
| CX: 3afe68fe44e8d4620 | |
| MIXBREAD_API_KEY: emb_f838d0f14ue7d61907d7f28fd643s8eaf49c0da2wf32f22a | |
| PINECONE_API_KEY: pcsk_7LufHa_aUYWm5r5WwF1LBhfujiKftHWLX9iU6fyYxtkDukMnZZQKMWQJcXrFmhzt7GtVtJ | |
| AZURE_API_KEY: 1JCm7aFbY2zVyXndOwAaljohGFAeFKjvwmDLa200gjSdlsLOqP3yJQQJ99BBACREanaXJ3w3AbgAACOG2ZyA | |
| GOOGLE_API_KEY: Adzac4B4-q3u3Q_lssqr_dc7k-WM28ygszsVrIe | |
| CREDIBILITY_API_URL: https://credibility-api.example.com | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # Add permissions configuration | |
| permissions: | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies for mainService | |
| run: | | |
| cd backend/mainService | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements-test.txt | |
| - name: Install dependencies for metricService | |
| run: | | |
| cd backend/metricsService | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r requirements-test.txt | |
| - name: Run tests | |
| run: | | |
| cd backend/mainService | |
| python -m pytest | |
| cd ../metricsService | |
| python -m pytest | |
| - name: Close failed PR | |
| if: failure() && github.event_name == 'pull_request' | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| await github.rest.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| state: 'closed' | |
| }); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: 'This PR was automatically closed because the CI pipeline failed.' | |
| }); |