Skip to content

Commit f7922f1

Browse files
committed
ci(*): added emulator support
1 parent 48088b8 commit f7922f1

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

.github/workflows/test.yaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,35 @@ jobs:
2525
version: latest
2626
- name: Install dependencies
2727
run: pnpm install
28-
- name: Run tests
29-
run: pnpm test
28+
- name: Install Firebase CLI
29+
uses: nick-invision/retry@v1
30+
with:
31+
timeout_minutes: 10
32+
retry_wait_seconds: 60
33+
max_attempts: 3
34+
command: npm i -g firebase-tools@latest
35+
- name: Start Firebase emulator and run tests
36+
run: |
37+
firebase emulators:start --only auth --project demo-test &
38+
sleep 20
39+
# Wait for emulator to be ready with timeout
40+
timeout=60
41+
while [ $timeout -gt 0 ]; do
42+
if wget -q --spider http://localhost:9099 2>/dev/null; then
43+
echo "Emulator is ready!"
44+
# Test the emulator response
45+
wget -q -O - http://localhost:9099 | head -3
46+
break
47+
fi
48+
echo "Waiting for emulator to start... ($timeout seconds remaining)"
49+
sleep 2
50+
timeout=$((timeout - 2))
51+
done
52+
if [ $timeout -le 0 ]; then
53+
echo "Emulator failed to start within timeout"
54+
echo "Checking if emulator process is running:"
55+
ps aux | grep firebase
56+
exit 1
57+
fi
58+
echo "Running tests..."
59+
pnpm test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@firebaseui/root",
33
"private": true,
44
"scripts": {
5-
"emulators": "firebase emulators:start --only auth",
5+
"emulators": "firebase emulators:start --only auth --project demo-test",
66
"build": "pnpm run build:translations && pnpm run build:core && pnpm run build:react",
77
"build:core": "pnpm --filter=@firebase-ui/core run build",
88
"build:translations": "pnpm --filter=@firebase-ui/translations run build",

0 commit comments

Comments
 (0)