Skip to content

Add bundle size CI check using size-limit #2

Add bundle size CI check using size-limit

Add bundle size CI check using size-limit #2

Workflow file for this run

name: Bundle Size
on:
pull_request:
branches:
- master
paths:
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.size-limit.json'
- '.github/workflows/bundle-size.yml'
push:
branches:
- master
paths:
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.size-limit.json'
- '.github/workflows/bundle-size.yml'
jobs:
size:
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
env:
CI_JOB_NUMBER: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Check bundle size
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
build_script: build