chore(deps-dev): bump webpack-cli from 6.0.1 to 7.2.2 #198
Workflow file for this run
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: Statoscope | |
| # PR-only: compares the PR build against statoscope/reference.json, which is | |
| # regenerated locally by `make newversion` on each release. The bot must not | |
| # push to main. | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| statoscope: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Build with Statoscope | |
| run: make build es=es2021 uglify=true fat=true statoscope=true | |
| # Compare against the committed reference | |
| - name: Generate size report | |
| id: sizes | |
| run: | | |
| if [ ! -f statoscope/reference.json ]; then | |
| echo "has_reference=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "has_reference=true" >> "$GITHUB_OUTPUT" | |
| REF=$(npx @statoscope/cli query \ | |
| --input statoscope/reference.json \ | |
| --query '$[0].compilations.pick().assets.({name, size: info.size})') | |
| NEXT=$(npx @statoscope/cli query \ | |
| --input statoscope/reference.next.json \ | |
| --query '$[0].compilations.pick().assets.({name, size: info.size})') | |
| node -e " | |
| const ref = JSON.parse(process.argv[1]); | |
| const next = JSON.parse(process.argv[2]); | |
| const fmt = (b) => (b / 1024).toFixed(2) + ' KB'; | |
| const fmtDiff = (d) => { | |
| if (d === 0) return '—'; | |
| const kb = (d / 1024).toFixed(2); | |
| return (d > 0 ? '+' : '') + kb + ' KB'; | |
| }; | |
| let table = '| Asset | Reference | Current | Diff |\n|---|--:|--:|--:|\n'; | |
| let totalRef = 0, totalNext = 0; | |
| for (const n of next) { | |
| const r = ref.find(x => x.name === n.name); | |
| const rSize = r ? r.size : 0; | |
| const diff = n.size - rSize; | |
| totalRef += rSize; | |
| totalNext += n.size; | |
| const icon = diff > 0 ? '🔺' : diff < 0 ? '🟢' : ''; | |
| table += '| ' + n.name + ' | ' + fmt(rSize) + ' | ' + fmt(n.size) + ' | ' + icon + ' ' + fmtDiff(diff) + ' |\n'; | |
| } | |
| const totalDiff = totalNext - totalRef; | |
| const icon = totalDiff > 0 ? '🔺' : totalDiff < 0 ? '🟢' : ''; | |
| table += '| **Total** | **' + fmt(totalRef) + '** | **' + fmt(totalNext) + '** | ' + icon + ' **' + fmtDiff(totalDiff) + '** |\n'; | |
| const fs = require('fs'); | |
| fs.appendFileSync(process.env.GITHUB_OUTPUT, 'table<<SIZES_EOF\n' + table + 'SIZES_EOF\n'); | |
| " "$REF" "$NEXT" | |
| - name: Validate rules | |
| if: steps.sizes.outputs.has_reference == 'true' | |
| id: validate | |
| run: | | |
| set +e | |
| OUTPUT=$(npx @statoscope/cli validate \ | |
| --input statoscope/reference.next.json \ | |
| --reference statoscope/reference.json 2>&1) | |
| EXIT_CODE=$? | |
| echo "$OUTPUT" | |
| { | |
| echo "result<<STATOSCOPE_EOF" | |
| echo "$OUTPUT" | |
| echo "STATOSCOPE_EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "exit_code=$EXIT_CODE" >> "$GITHUB_OUTPUT" | |
| - name: Generate diff report | |
| if: steps.sizes.outputs.has_reference == 'true' | |
| run: | | |
| npx @statoscope/cli generate \ | |
| --input statoscope/reference.next.json \ | |
| --reference statoscope/reference.json \ | |
| --output build/statoscope-diff.html | |
| - name: Upload diff report | |
| if: steps.sizes.outputs.has_reference == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: statoscope-diff | |
| path: build/statoscope-diff.html | |
| retention-days: 30 | |
| - name: Comment PR | |
| if: steps.sizes.outputs.has_reference == 'true' | |
| uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v2 | |
| with: | |
| header: statoscope | |
| message: | | |
| ## 📊 Bundle Size | |
| ${{ steps.sizes.outputs.table }} | |
| <details> | |
| <summary>Validation details</summary> | |
| ``` | |
| ${{ steps.validate.outputs.result }} | |
| ``` | |
| </details> | |
| ${{ steps.validate.outputs.exit_code == '0' && '✅ All checks passed' || '⚠️ Some checks failed' }} · [Full diff report →](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) (see Artifacts) | |
| - name: Comment PR (no reference) | |
| if: steps.sizes.outputs.has_reference != 'true' | |
| uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v2 | |
| with: | |
| header: statoscope | |
| message: | | |
| ## 📊 Bundle Size | |
| No reference stats in `main` yet. Comparison will be available after first merge. |