name: Frontend CI on: push: branches: - main - tabler - v3 - v4 paths: - 'frontend/**' - '.gitea/workflows/frontend-ci.yml' pull_request: branches: - main - tabler - v3 - v4 paths: - 'frontend/**' - '.gitea/workflows/frontend-ci.yml' jobs: frontend: runs-on: ubuntu-latest defaults: run: working-directory: frontend steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' cache-dependency-path: frontend/package-lock.json - name: Install dependencies run: npm ci - name: Lint run: npm run lint - name: Build run: npm run build - name: Check bundle size id: bundle-size run: | SIZE_BYTES=$(du -sb dist | cut -f1) SIZE_MB=$(awk "BEGIN {printf \"%.2f\", $SIZE_BYTES / 1048576}") echo "size_bytes=$SIZE_BYTES" >> $GITHUB_OUTPUT echo "size_mb=$SIZE_MB" >> $GITHUB_OUTPUT echo "## Bundle size: ${SIZE_MB} MB" >> $GITHUB_STEP_SUMMARY # Fail if total bundle exceeds 5MB BUNDLE_LIMIT_BYTES=5242880 if [ "$SIZE_BYTES" -gt "$BUNDLE_LIMIT_BYTES" ]; then echo "::error::Bundle size (${SIZE_MB} MB) exceeds 5MB limit" exit 1 fi