Fixing linting issues #195
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: Frontend CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'frontend/**' | |
| - '.github/workflows/frontend.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'frontend/**' | |
| - '.github/workflows/frontend.yml' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Biome check | |
| run: npm run check | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests with coverage | |
| run: npm run test:coverage | |
| - name: Upload coverage to Octocov | |
| uses: k1LoW/octocov-action@v1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| config: frontend/.octocov.yml | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [lint, test] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Upload bundle analysis | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: bundle-stats | |
| path: frontend/dist/bundle-analyzer.html | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| bundle-size: | |
| name: Bundle Size | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Report bundle size | |
| uses: preactjs/compressed-size-action@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| pattern: "frontend/dist/**/*.{js,css,html}" | |
| build-script: "build" | |
| cwd: "./frontend" |