feat: integrate error handling and toast notifications for improved u… #72
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - '.vscode/**' | |
| - '.idea/**' | |
| pull_request: | |
| branches: [main, develop] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - '.vscode/**' | |
| - '.idea/**' | |
| # Cancel in-progress runs for the same workflow and ref | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test & Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| id: cache-deps | |
| with: | |
| path: | | |
| node_modules | |
| ~/.cache | |
| key: ${{ runner.os }}-deps-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-deps- | |
| - name: Install dependencies | |
| if: steps.cache-deps.outputs.cache-hit != 'true' | |
| run: npm ci | |
| # Run linting first (fast failure) | |
| - name: Run linter | |
| run: npm run lint | |
| timeout-minutes: 2 | |
| # Run tests with CI-optimized script | |
| - name: Run tests | |
| run: npm run test:ci | |
| timeout-minutes: 5 | |
| env: | |
| CI: true | |
| NODE_ENV: test | |
| # Only generate coverage on main branch to save time | |
| - name: Generate coverage (main branch only) | |
| if: github.ref == 'refs/heads/main' | |
| run: npm run test:coverage | |
| - name: Upload coverage to artifacts (main branch only) | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 7 | |
| build: | |
| name: Build Check | |
| runs-on: ubuntu-latest | |
| needs: test | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| ~/.cache | |
| key: ${{ runner.os }}-deps-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-deps- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| timeout-minutes: 5 | |
| env: | |
| CI: true | |
| - name: Check build size | |
| run: | | |
| echo "Build completed successfully" | |
| echo "Build size:" | |
| du -sh dist/ | |
| echo "Detailed breakdown:" | |
| du -h dist/ | sort -hr | head -10 |