Skip to content

Commit a97dc86

Browse files
committed
Add CI workflow for automated testing and build processes, including separate pipelines for server and client. Update package.json and package-lock.json with new testing dependencies and scripts. Implement Vitest configuration and setup for comprehensive testing of application components and APIs.
1 parent ce04000 commit a97dc86

File tree

13 files changed

+3926
-48
lines changed

13 files changed

+3926
-48
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
# Pipeline A: Server (test → build)
11+
server-pipeline:
12+
name: Server Pipeline
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: "1.21"
23+
24+
- name: Make test script executable
25+
run: chmod +x tests/server/run.sh
26+
27+
- name: 🧪 Run server tests
28+
run: tests/server/run.sh
29+
30+
- name: 🔨 Build server executable
31+
run: |
32+
cd excalidraw-server
33+
go build -o excalidraw-server
34+
echo "✅ Server built successfully"
35+
36+
- name: Upload server artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: excalidraw-server
40+
path: excalidraw-server/excalidraw-server
41+
42+
# Pipeline B: Client (test → build)
43+
client-pipeline:
44+
name: Client Pipeline
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: "20"
55+
cache: "npm"
56+
cache-dependency-path: excalidraw-app/package-lock.json
57+
58+
- name: Make test script executable
59+
run: chmod +x tests/client/run.sh
60+
61+
- name: 🧪 Run client tests
62+
run: tests/client/run.sh
63+
64+
- name: 🔨 Build client
65+
run: |
66+
cd excalidraw-app
67+
npm ci
68+
npm run build
69+
echo "✅ Client built successfully"
70+
71+
- name: Upload client artifact
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: excalidraw-client
75+
path: excalidraw-app/dist

0 commit comments

Comments
 (0)