size-data.yml 1.4 KB

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