-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.16 KB
/
python-ci-cd.yml
File metadata and controls
74 lines (64 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
SERVERLESS: FALSE
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.'
});