build(deps-dev): Bump prettier from 3.6.2 to 3.7.4 #45
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, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| jobs: | |
| test: | |
| name: Test on Node ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x, 22.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| # Version is determined from packageManager field in package.json | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run linter | |
| run: pnpm run lint | |
| - name: Run type check | |
| run: pnpm run typecheck | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Run test coverage | |
| run: pnpm run coverage | |
| - name: Build library | |
| run: pnpm run build | |
| - name: Upload coverage reports | |
| if: matrix.node-version == '20.x' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| file: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| build-check: | |
| name: Build and Package Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| - name: Check build output | |
| run: | | |
| # Check if all expected files are generated | |
| test -f dist/beatbox.js | |
| test -f dist/beatbox.cjs | |
| test -f dist/beatbox.umd.js | |
| test -f dist/index.d.ts | |
| echo "✓ All build files generated successfully" | |
| - name: Pack for npm | |
| run: pnpm pack | |
| - name: Check package size | |
| run: | | |
| # Display package size | |
| ls -lh *.tgz | |
| # Check if package size is reasonable (< 1MB) | |
| size=$(stat -c%s *.tgz) | |
| if [ $size -gt 1048576 ]; then | |
| echo "⚠️ Warning: Package size is larger than 1MB" | |
| else | |
| echo "✓ Package size is reasonable" | |
| fi | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: | | |
| dist/ | |
| *.tgz | |
| retention-days: 7 |