Skip to content

Commit 1cc62dc

Browse files
committed
Implement CI/CD pipeline including frontend, backend, integration tests, and deployment.
1 parent c4dc113 commit 1cc62dc

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
frontend-tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
cache-dependency-path: client/package-lock.json
20+
- name: Install dependencies
21+
run: cd client && npm ci
22+
- name: Run tests
23+
run: cd client && npm run test
24+
25+
backend-tests:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
enable-cache: true
33+
cache-dependency-path: server/uv.lock
34+
- name: Set up Python
35+
run: uv python install
36+
- name: Install dependencies
37+
run: cd server && uv sync
38+
- name: Run backend tests
39+
run: |
40+
cd server
41+
PYTHONPATH=. uv run pytest
42+
43+
integration-tests:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
with:
50+
enable-cache: true
51+
cache-dependency-path: server/uv.lock
52+
- name: Set up Python
53+
run: uv python install
54+
- name: Install dependencies
55+
run: cd server && uv sync
56+
- name: Run integration tests
57+
run: |
58+
cd server
59+
PYTHONPATH=. uv run pytest tests_integration
60+
61+
deploy:
62+
needs: [frontend-tests, backend-tests, integration-tests]
63+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Trigger Render Deployment
67+
run: |
68+
curl -X POST ${{ secrets.RENDER_DEPLOY_HOOK_URL }}

0 commit comments

Comments
 (0)