scripts.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Scripts
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. branches:
  6. - "main"
  7. paths:
  8. - "packages/astro/src/runtime/client/**/*"
  9. # Automatically cancel in-progress actions on the same branch
  10. concurrency:
  11. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
  12. cancel-in-progress: true
  13. defaults:
  14. run:
  15. shell: bash
  16. jobs:
  17. bundle:
  18. name: Bundle Size
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: Checkout Repo
  22. uses: actions/checkout@v4
  23. - name: Checkout Main into tmp
  24. uses: actions/checkout@v4
  25. with:
  26. ref: main
  27. path: main
  28. - name: Setup PNPM
  29. uses: pnpm/action-setup@v2
  30. - name: Setup Node
  31. uses: actions/setup-node@v4
  32. with:
  33. node-version: 18
  34. cache: "pnpm"
  35. - name: Install dependencies
  36. run: pnpm install
  37. - name: Check Bundle Size
  38. uses: actions/github-script@v7
  39. with:
  40. script: |
  41. const { default: script } = await import('${{ github.workspace }}/.github/scripts/bundle-size.mjs')
  42. await script({ github, context })