Skip to content

Commit c212fc8

Browse files
committed
Add CI workflow to run unit and integration tests on PRs
https://claude.ai/code/session_0161hwiY52dSwBergfZmniKA
1 parent b802da9 commit c212fc8

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
unit-tests:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '20'
17+
18+
- uses: pnpm/action-setup@v4
19+
20+
- name: Install dependencies
21+
run: pnpm install
22+
23+
- name: Run unit tests
24+
run: pnpm test
25+
26+
integration-tests:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
36+
- uses: pnpm/action-setup@v4
37+
38+
- name: Install dependencies
39+
run: pnpm install
40+
41+
- name: Install Playwright Chromium
42+
run: pnpm --filter @git-glimpse/core exec playwright install chromium --with-deps
43+
44+
- name: Start example app
45+
run: node examples/simple-app/server.js &
46+
47+
- name: Wait for app to be ready
48+
run: |
49+
for i in $(seq 1 15); do
50+
curl -sf http://localhost:3000 && echo "App ready" && exit 0
51+
echo "Waiting... ($i)"
52+
sleep 1
53+
done
54+
echo "App did not become ready" && exit 1
55+
56+
- name: Run integration tests
57+
run: pnpm test:integration

0 commit comments

Comments
 (0)