Skip to content

feat: implement shimmer SkeletonLoader and fix quizStore index persistence bug #122

feat: implement shimmer SkeletonLoader and fix quizStore index persistence bug

feat: implement shimmer SkeletonLoader and fix quizStore index persistence bug #122

Workflow file for this run

name: Test Suite (Optimized)
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
# ==============================
# 📦 DEPENDENCY CACHING
# ==============================
- name: Cache node_modules
id: cache-deps
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit
# ==============================
# 🧪 JEST CACHE
# ==============================
- name: Cache Jest
uses: actions/cache@v4
with:
path: |
.jest-cache
coverage
key: ${{ runner.os }}-jest-${{ hashFiles('jest.config.js', 'src/**/*.test.ts', 'src/**/*.test.tsx', 'src/**/*.ts', 'src/**/*.tsx') }}
restore-keys: |
${{ runner.os }}-jest-
# ==============================
# 🧪 RUN TESTS
# ==============================
- name: Run unit tests
run: npm test -- --runInBand --cache --cacheDirectory=.jest-cache
- name: Run performance regression tests
run: npm test -- --testPathPattern=perf --runInBand --cache --cacheDirectory=.jest-cache
- name: Check performance budgets
run: npm test -- --testPathPattern=perf --runInBand --verbose --cache --cacheDirectory=.jest-cache
# ==============================
# 📊 COVERAGE REPORT
# ==============================
- name: Upload coverage to artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
retention-days: 7
- name: Generate test summary
if: always()
run: |
echo "## 🧪 Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ All tests passed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Cache Hit:** ${{ steps.cache-deps.outputs.cache-hit == 'true' && '✅ Yes' || '❌ No' }}" >> $GITHUB_STEP_SUMMARY