size report #11436
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: size report | |
| on: | |
| workflow_run: | |
| workflows: ['size data'] | |
| types: | |
| - completed | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| env: | |
| PUPPETEER_SKIP_DOWNLOAD: 'true' | |
| jobs: | |
| size-report: | |
| runs-on: ubuntu-slim | |
| if: > | |
| github.repository == 'vuejs/core' && | |
| github.event.workflow_run.event == 'pull_request' && | |
| github.event.workflow_run.conclusion == 'success' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| - name: Install Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: '.node-version' | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Download Size Data | |
| uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 | |
| with: | |
| name: size-data | |
| run_id: ${{ github.event.workflow_run.id }} | |
| path: temp/size | |
| - parallel: | |
| - name: Read PR Number | |
| id: pr-number | |
| uses: juliangruber/read-file-action@271ff311a4947af354c6abcd696a306553b9ec18 # v1.1.8 | |
| with: | |
| path: temp/size/number.txt | |
| - name: Read base branch | |
| id: pr-base | |
| uses: juliangruber/read-file-action@271ff311a4947af354c6abcd696a306553b9ec18 # v1.1.8 | |
| with: | |
| path: temp/size/base.txt | |
| - name: Download Previous Size Data | |
| uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 | |
| with: | |
| branch: ${{ steps.pr-base.outputs.content }} | |
| workflow: size-data.yml | |
| event: push | |
| name: size-data | |
| path: temp/size-prev | |
| if_no_artifact_found: warn | |
| - name: Prepare report | |
| run: node scripts/size-report.js > size-report.md | |
| - name: Read Size Report | |
| id: size-report | |
| uses: juliangruber/read-file-action@271ff311a4947af354c6abcd696a306553b9ec18 # v1.1.8 | |
| with: | |
| path: ./size-report.md | |
| - name: Create Comment | |
| # The original action repository is blocked by GitHub, so use its backup pinned to a commit. | |
| uses: actions-cool/maintain-one-comment-backup@fbbc22ad1809c1bcf46f19b58397b6254773588c # backup for v3.0.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| number: ${{ steps.pr-number.outputs.content }} | |
| body: | | |
| ${{ steps.size-report.outputs.content }} | |
| <!-- VUE_CORE_SIZE --> | |
| body-include: '<!-- VUE_CORE_SIZE -->' |