Skip to content

Commit 0b5fbb1

Browse files
Update ci.yml
1 parent 2ac3454 commit 0b5fbb1

1 file changed

Lines changed: 14 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212

13-
services:
14-
mongodb:
15-
image: mongo:latest
16-
ports:
17-
- 27017:27017
18-
options: >-
19-
--health-cmd "mongosh --eval 'db.adminCommand({ping: 1})'"
20-
--health-interval 10s
21-
--health-timeout 5s
22-
--health-retries 5
2313

2414
steps:
2515
- uses: actions/checkout@v4
@@ -34,21 +24,19 @@ jobs:
3424
python -m pip install --upgrade pip
3525
pip install -r requirements.txt
3626
37-
- name: Wait for MongoDB
38-
run: |
39-
sleep 10
27+
4028

4129
- name: Run unit tests
4230
env:
4331
CI: true
4432
run: |
45-
python -m pytest tests.py -v
33+
python -m pytest test_api.py -v
4634
4735
- name: Run coverage
4836
env:
4937
CI: true
5038
run: |
51-
coverage run --source=main,db,models -m unittest tests.py
39+
coverage run --source=main,db,models -m unittest test_unit.py
5240
coverage report -m
5341
coverage xml
5442
@@ -77,16 +65,7 @@ jobs:
7765
needs: test
7866
runs-on: ubuntu-latest
7967

80-
services:
81-
mongodb:
82-
image: mongo:latest
83-
ports:
84-
- 27017:27017
85-
options: >-
86-
--health-cmd "mongosh --eval 'db.adminCommand({ping: 1})'"
87-
--health-interval 10s
88-
--health-timeout 5s
89-
--health-retries 5
68+
9069

9170
steps:
9271
- uses: actions/checkout@v4
@@ -101,9 +80,7 @@ jobs:
10180
python -m pip install --upgrade pip
10281
pip install -r requirements.txt
10382
104-
- name: Wait for MongoDB
105-
run: |
106-
sleep 10
83+
10784
10885
- name: Start FastAPI server
10986
env:
@@ -126,3 +103,12 @@ jobs:
126103
CI: true
127104
KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}
128105
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/

0 commit comments

Comments
 (0)