-
-
Notifications
You must be signed in to change notification settings - Fork 554
40 lines (36 loc) · 1.41 KB
/
size-limit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Size Limit
on:
pull_request:
branches: [main]
# 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
jobs:
# This basic check runs size-limit for the current branch.
# It will fail if the branch pushes the size over the specified budget.
size-limit-basic:
if: ${{ github.event.pull_request.head.repo.full_name != 'withastro/starlight' }}
name: Check build output is within performance budget (forks)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- run: pnpm i
- run: 'pnpm build:examples'
- run: pnpm size
# This check cannot run in forks, so is only run for PRs from this repo.
# It will run size-limit for both `main` and the PR branch and comment in the PR with changes.
size-limit:
if: ${{ github.event.pull_request.head.repo.full_name == 'withastro/starlight' }}
name: Check build output is within performance budget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Run size-limit
uses: andresz1/[email protected]
with:
github_token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
build_script: 'build:examples'
package_manager: pnpm