Skip to content

Commit da14da0

Browse files
Update ci.yml
1 parent 461b989 commit da14da0

1 file changed

Lines changed: 17 additions & 106 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,25 @@
1-
name: CI/CD with Keploy API Testing
1+
name: Run Keploy API Tests
22

33
on:
44
push:
5-
branches: [ main, develop ]
6-
pull_request:
7-
branches: [ main ]
5+
branches:
6+
- main
87

98
jobs:
10-
test:
9+
keploy-tests:
1110
runs-on: ubuntu-latest
12-
1311

1412
steps:
15-
- uses: actions/checkout@v4
16-
17-
- name: Set up Python
18-
uses: actions/setup-python@v5
19-
with:
20-
python-version: '3.11'
21-
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install -r requirements.txt
26-
27-
28-
29-
- name: Run unit tests
30-
env:
31-
CI: true
32-
run: |
33-
python -m pytest test_unit.py -v
34-
35-
- name: Run coverage
36-
env:
37-
CI: true
38-
run: |
39-
coverage run --source=main,db,models -m unittest test_unit.py
40-
coverage report -m
41-
coverage xml
42-
43-
- name: Start FastAPI server
44-
env:
45-
CI: true
46-
run: |
47-
uvicorn main:app --host 0.0.0.0 --port 8000 &
48-
sleep 10
49-
50-
- name: Test server is running
51-
run: |
52-
curl -f http://localhost:8000/docs || exit 1
53-
54-
- name: Generate OpenAPI Schema
55-
run: |
56-
python generate_openapi.py
57-
58-
- name: Upload OpenAPI Schema
59-
uses: actions/upload-artifact@v4
60-
with:
61-
name: openapi-schema
62-
path: openapi.json
63-
64-
keploy-api-testing:
65-
needs: test
66-
runs-on: ubuntu-latest
67-
68-
69-
70-
steps:
71-
- uses: actions/checkout@v4
72-
73-
- name: Set up Python
74-
uses: actions/setup-python@v5
75-
with:
76-
python-version: '3.11'
77-
78-
- name: Install dependencies
79-
run: |
80-
python -m pip install --upgrade pip
81-
pip install -r requirements.txt
82-
83-
84-
85-
- name: Start FastAPI server
86-
env:
87-
CI: true
88-
run: |
89-
uvicorn main:app --host 0.0.0.0 --port 8000 &
90-
sleep 10
91-
92-
- name: Download OpenAPI Schema
93-
uses: actions/download-artifact@v4
94-
with:
95-
name: openapi-schema
96-
97-
- name: Install Keploy CLI
98-
run: |
99-
curl --silent -L https://keploy.io/ent/install.sh | bash
100-
101-
- name: Run Keploy Test Suite
102-
env:
103-
CI: true
104-
KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}
105-
run: |
106-
107-
- name: Upload Keploy Test Reports
108-
uses: actions/upload-artifact@v4
109-
if: always()
110-
with:
111-
name: keploy-reports
112-
path: |
113-
keploy/
114-
test-reports/
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Install Keploy CLI
17+
run: |
18+
curl --silent -L https://keploy.io/ent/install.sh | bash
19+
20+
- name: Run Keploy Test Suite
21+
run: |
22+
export KEPLOY_API_KEY=${{ secrets.KEPLOY_API_KEY}} && \
23+
keploy test-suite --app=97d75330-5487-474d-81f5-2b3d8f88cc06 \
24+
--base-path=https://task-flow-hazel-xi.vercel.app/ \
25+
--cloud

0 commit comments

Comments
 (0)