Update from main #224
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 Size Report | |
| on: | |
| pull_request: | |
| branches: [production] | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| bundle-size: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| path: pr-build | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "npm" | |
| cache-dependency-path: pr-build/package-lock.json | |
| - name: Find latest tag | |
| id: latest-tag | |
| run: | | |
| TAG=$(cd pr-build && git tag --sort=-v:refname | grep -v '^production$' | head -1) | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v6 | |
| continue-on-error: true | |
| id: checkout-tag | |
| with: | |
| path: tag-build | |
| ref: ${{ steps.latest-tag.outputs.tag }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - parallel: | |
| - name: Build tag | |
| continue-on-error: true | |
| run: | | |
| if [ -d "tag-build" ] && [ -f "tag-build/package.json" ]; then | |
| cd tag-build && npm ci && NO_COLOR=true npm run build 2>&1 | grep '^dist/' > ../tag-sizes.txt | |
| fi | |
| - name: Build PR | |
| working-directory: pr-build | |
| run: | | |
| npm ci && NO_COLOR=true npm run build 2>&1 | grep '^dist/' > ../pr-sizes.txt | |
| - name: Generate diff report | |
| env: | |
| REF_TAG: ${{ steps.latest-tag.outputs.tag }} | |
| run: node pr-build/scripts/bundle-sizes-diff-md.js tag-sizes.txt pr-sizes.txt > bundle-sizes.md | |
| - name: Comment on PR | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| hide_and_recreate: true | |
| header: bundle-size | |
| path: bundle-sizes.md |