2022-05-26 11:49:29 -05:00
|
|
|
name: Scripts
|
|
|
|
|
|
|
|
on:
|
2023-03-01 09:02:35 -05:00
|
|
|
workflow_dispatch:
|
2022-05-26 11:49:29 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-02-24 10:52:43 -05:00
|
|
|
- "main"
|
2022-07-11 15:11:01 -05:00
|
|
|
paths:
|
2023-02-24 10:52:43 -05:00
|
|
|
- "packages/astro/src/runtime/client/**/*"
|
2024-02-26 08:38:19 -05:00
|
|
|
- "!packages/astro/src/runtime/client/dev-toolbar/**/*"
|
2022-05-26 11:49:29 -05:00
|
|
|
|
|
|
|
# Automatically cancel in-progress actions on the same branch
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
bundle:
|
|
|
|
name: Bundle Size
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-24 10:52:43 -05:00
|
|
|
steps:
|
2022-05-26 11:49:29 -05:00
|
|
|
- name: Checkout Repo
|
2024-02-09 01:35:00 -05:00
|
|
|
uses: actions/checkout@v4
|
2022-05-26 11:49:29 -05:00
|
|
|
|
|
|
|
- name: Checkout Main into tmp
|
2024-02-09 01:35:00 -05:00
|
|
|
uses: actions/checkout@v4
|
2022-05-26 11:49:29 -05:00
|
|
|
with:
|
|
|
|
ref: main
|
|
|
|
path: main
|
|
|
|
|
2022-10-28 13:36:50 -05:00
|
|
|
- name: Setup PNPM
|
2024-02-28 23:49:07 -05:00
|
|
|
uses: pnpm/action-setup@v3
|
2022-10-28 13:36:50 -05:00
|
|
|
|
|
|
|
- name: Setup Node
|
2024-02-09 01:35:00 -05:00
|
|
|
uses: actions/setup-node@v4
|
2022-10-28 13:36:50 -05:00
|
|
|
with:
|
2023-07-24 13:47:07 -05:00
|
|
|
node-version: 18
|
2023-02-24 10:52:43 -05:00
|
|
|
cache: "pnpm"
|
2022-10-28 13:36:50 -05:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
2023-02-24 10:52:43 -05:00
|
|
|
|
2022-05-26 11:49:29 -05:00
|
|
|
- name: Check Bundle Size
|
2024-02-09 01:35:00 -05:00
|
|
|
uses: actions/github-script@v7
|
2022-05-26 11:49:29 -05:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const { default: script } = await import('${{ github.workspace }}/.github/scripts/bundle-size.mjs')
|
|
|
|
await script({ github, context })
|