ci(*): added workflows and issues templates #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
check-latest: true | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install Firebase CLI | |
uses: nick-invision/retry@v1 | |
with: | |
timeout_minutes: 10 | |
retry_wait_seconds: 60 | |
max_attempts: 3 | |
command: npm i -g [email protected] | |
- name: Start Firebase emulator and run tests | |
run: | | |
firebase emulators:start --only auth --project demo-test & | |
sleep 20 | |
# Wait for emulator to be ready with timeout | |
timeout=60 | |
while [ $timeout -gt 0 ]; do | |
if wget -q --spider http://localhost:9099 2>/dev/null; then | |
echo "Emulator is ready!" | |
# Test the emulator response | |
wget -q -O - http://localhost:9099 | head -3 | |
break | |
fi | |
echo "Waiting for emulator to start... ($timeout seconds remaining)" | |
sleep 2 | |
timeout=$((timeout - 2)) | |
done | |
if [ $timeout -le 0 ]; then | |
echo "Emulator failed to start within timeout" | |
echo "Checking if emulator process is running:" | |
ps aux | grep firebase | |
exit 1 | |
fi | |
echo "Running tests..." | |
pnpm test |