Skip to content

Commit 2f7a2c3

Browse files
refactor: Update CI workflow to specify Mongo 6, adjust Python and Node versions, refine backend verification, and enhance frontend build caching.
1 parent 2d30364 commit 2f7a2c3

1 file changed

Lines changed: 29 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,60 @@ on:
99
jobs:
1010
backend-test:
1111
runs-on: ubuntu-latest
12+
1213
services:
1314
mongo:
14-
image: mongo:latest
15+
image: mongo:6
1516
ports:
1617
- 27017:27017
18+
1719
steps:
18-
- uses: actions/checkout@v3
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
1923
- name: Set up Python
2024
uses: actions/setup-python@v4
2125
with:
22-
python-version: '3.13'
23-
- name: Install dependencies
26+
python-version: "3.11"
27+
28+
- name: Install backend dependencies
2429
run: |
2530
python -m pip install --upgrade pip
2631
pip install -r backend/requirements.txt
32+
2733
- name: Start Backend
2834
env:
29-
MONGODB_URL: mongodb://localhost:27017
30-
SECRET_KEY: testsecret
35+
MONGO_URI: mongodb://localhost:27017
36+
SECRET_KEY: test-secret
3137
run: |
3238
cd backend
33-
python -m uvicorn app.main:app --host 0.0.0.0 --port 8001 &
34-
sleep 10 # Wait for startup
35-
- name: Run Verification
39+
uvicorn app.main:app --host 0.0.0.0 --port 8000 &
40+
sleep 8
41+
42+
- name: Verify Backend APIs
3643
run: |
37-
cd backend
38-
python verify_backend.py
44+
python backend/app/routes/api/v1/health.py
3945
4046
frontend-build:
4147
runs-on: ubuntu-latest
48+
4249
steps:
43-
- uses: actions/checkout@v3
44-
- name: Set up Node
50+
- name: Checkout code
51+
uses: actions/checkout@v3
52+
53+
- name: Set up Node.js
4554
uses: actions/setup-node@v3
4655
with:
47-
node-version: '18'
48-
- name: Install dependencies
56+
node-version: "18"
57+
cache: "npm"
58+
cache-dependency-path: frontend/package-lock.json
59+
60+
- name: Install frontend dependencies
4961
run: |
5062
cd frontend
5163
npm ci
52-
- name: Build
64+
65+
- name: Build frontend
5366
run: |
5467
cd frontend
5568
npm run build

0 commit comments

Comments
 (0)