Create Component Library #38
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: Bundle Analysis | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| jobs: | |
| analyze: | |
| name: Analyze bundle size | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build with analysis | |
| run: | | |
| npm run build | |
| npx next-bundle-analyzer .next/analyze/ | |
| - name: Upload bundle analysis | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: bundle-analysis | |
| path: .next/analyze/ | |
| retention-days: 7 | |
| check-size: | |
| name: Check bundle size | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check bundle size | |
| uses: andresz1/size-limit-action@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| build_script: "npm run build" | |
| # Adjust these thresholds based on your needs | |
| max_size: "500 KB" | |
| # Optional: Check individual chunks | |
| # files: | |
| # - ".next/static/chunks/**/*.js" | |
| # - ".next/static/css/**/*.css" | |
| env: | |
| NEXT_PUBLIC_NETWORK: testnet | |
| NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID }} |