-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (50 loc) · 1.46 KB
/
Copy pathci.yml
File metadata and controls
64 lines (50 loc) · 1.46 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
frontend-tests:
name: Frontend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run frontend tests
run: node --test tests/frontend.test.js
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run backend tests
run: node --test tests/backend.test.js
docker-build:
name: Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t cv-manager:test .
- name: Verify container starts
run: |
docker run -d --name cv-test -p 3000:3000 -p 3001:3001 cv-manager:test
for i in 1 2 3 4 5; do
curl -sf http://localhost:3000/api/profile && break
echo "Waiting for server to start (attempt $i)..."
sleep 3
done
curl -f http://localhost:3000/api/profile || (docker logs cv-test && exit 1)
curl -f http://localhost:3001/api/profile || (docker logs cv-test && exit 1)
docker stop cv-test