size-data.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: size data
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. - minor
  10. permissions:
  11. contents: read
  12. env:
  13. PUPPETEER_SKIP_DOWNLOAD: 'true'
  14. jobs:
  15. upload:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Install pnpm
  20. uses: pnpm/action-setup@v3.0.0
  21. - name: Install Node.js
  22. uses: actions/setup-node@v4
  23. with:
  24. node-version-file: '.node-version'
  25. cache: pnpm
  26. - name: Install dependencies
  27. run: pnpm install
  28. - run: pnpm run size
  29. - name: Download Previous Size Data
  30. uses: dawidd6/action-download-artifact@v2
  31. if: ${{ github.event_name == 'push' }}
  32. with:
  33. branch: main
  34. workflow: size-data.yml
  35. event: push
  36. name: size-data
  37. path: temp/size-prev
  38. if_no_artifact_found: warn
  39. - name: Upload Size Data
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: size-data
  43. path: temp/size
  44. - name: Save PR number
  45. if: ${{ github.event_name == 'pull_request' }}
  46. run: echo ${{ github.event.number }} > ./pr.txt
  47. - uses: actions/upload-artifact@v4
  48. if: ${{ github.event_name == 'pull_request' }}
  49. with:
  50. name: pr-number
  51. path: pr.txt
  52. - name: Size report
  53. if: ${{ github.event_name == 'push' }}
  54. run: pnpm tsx scripts/size-report.ts