refactor(ui): delegate DOM operations to deep modules #35
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: [master, main] | |
| pull_request: | |
| branches: [master, main] | |
| # Prevent concurrent CI runs on the same branch | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Lint and basic checks | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline | |
| - name: Run Prettier check | |
| run: npm run lint | |
| # Test on multiple Node.js versions | |
| test: | |
| name: Test (Node ${{ matrix.node-version }}) | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline | |
| - name: Run tests | |
| run: npx jest --runInBand --coverage | |
| - name: Upload coverage report | |
| if: matrix.node-version == 24 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| # Build verification | |
| build: | |
| name: Build verification | |
| needs: [lint, test] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline | |
| - name: Build CSS | |
| run: npm run build:css | |
| - name: Verify build output | |
| run: | | |
| echo "📦 Verifying CSS build..." | |
| if [ -f "assets/app.css" ]; then | |
| SIZE=$(wc -c < assets/app.css) | |
| echo "✅ assets/app.css exists (${SIZE} bytes)" | |
| else | |
| echo "❌ assets/app.css missing" | |
| exit 1 | |
| fi | |
| - name: Prepare deployment bundle | |
| run: npm run prepare:deploy | |
| - name: Verify dist directory | |
| run: | | |
| echo "📦 Verifying dist directory..." | |
| ls -la dist/ | |
| # Check required files | |
| REQUIRED_FILES="index.html app.js sw.js manifest.webmanifest" | |
| for file in $REQUIRED_FILES; do | |
| if [ -f "dist/$file" ]; then | |
| echo "✅ $file" | |
| else | |
| echo "❌ Missing: $file" | |
| exit 1 | |
| fi | |
| done | |
| # Check directories | |
| for dir in src assets; do | |
| if [ -d "dist/$dir" ]; then | |
| echo "✅ $dir/ directory" | |
| else | |
| echo "❌ Missing: $dir/ directory" | |
| exit 1 | |
| fi | |
| done | |
| echo "" | |
| echo "✅ Build verification complete!" | |
| # Summary job for branch protection rules | |
| ci-passed: | |
| name: CI Passed | |
| needs: [lint, test, build] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Check CI status | |
| run: | | |
| if [[ "${{ needs.lint.result }}" != "success" || \ | |
| "${{ needs.test.result }}" != "success" || \ | |
| "${{ needs.build.result }}" != "success" ]]; then | |
| echo "❌ CI checks failed" | |
| exit 1 | |
| fi | |
| echo "✅ All CI checks passed" |