2
0

size-report.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: size report
  2. on:
  3. workflow_run:
  4. workflows: ['size data']
  5. types:
  6. - completed
  7. permissions:
  8. contents: read
  9. pull-requests: write
  10. issues: write
  11. env:
  12. PUPPETEER_SKIP_DOWNLOAD: 'true'
  13. jobs:
  14. size-report:
  15. runs-on: ubuntu-latest
  16. if: >
  17. github.event.workflow_run.event == 'pull_request' &&
  18. github.event.workflow_run.conclusion == 'success'
  19. steps:
  20. - uses: actions/checkout@v4
  21. - name: Install pnpm
  22. uses: pnpm/action-setup@v3.0.0
  23. - name: Install Node.js
  24. uses: actions/setup-node@v4
  25. with:
  26. node-version-file: '.node-version'
  27. cache: pnpm
  28. - name: Install dependencies
  29. run: pnpm install
  30. - name: Download Size Data
  31. uses: dawidd6/action-download-artifact@v3
  32. with:
  33. name: size-data
  34. run_id: ${{ github.event.workflow_run.id }}
  35. path: temp/size
  36. - name: Download Previous Size Data
  37. uses: dawidd6/action-download-artifact@v3
  38. with:
  39. branch: main
  40. workflow: size-data.yml
  41. event: push
  42. name: size-data
  43. path: temp/size-prev
  44. if_no_artifact_found: warn
  45. - name: Compare size
  46. run: pnpm tsx scripts/size-report.ts > size-report.md
  47. - name: Read Size Report
  48. id: size-report
  49. uses: juliangruber/read-file-action@v1
  50. with:
  51. path: ./size-report.md
  52. - name: Create Comment
  53. uses: actions-cool/maintain-one-comment@v3
  54. with:
  55. token: ${{ secrets.GITHUB_TOKEN }}
  56. body: |
  57. ${{ steps.size-report.outputs.content }}
  58. <!-- VUE_CORE_SIZE -->
  59. body-include: '<!-- VUE_CORE_SIZE -->'