2022-03-11 22:56:05 +08:00
|
|
|
name: 📦 Package Size Report
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2022-03-13 16:31:55 +08:00
|
|
|
branches:
|
|
|
|
- 'master'
|
2022-03-11 22:56:05 +08:00
|
|
|
types: [opened, synchronize]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
size-report:
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-10 19:24:16 +08:00
|
|
|
|
2022-03-11 22:56:05 +08:00
|
|
|
env:
|
|
|
|
CI_JOB_NUMBER: 1
|
2022-05-10 19:24:16 +08:00
|
|
|
|
2022-03-11 22:56:05 +08:00
|
|
|
steps:
|
2024-07-05 10:24:11 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-03-11 22:56:05 +08:00
|
|
|
|
|
|
|
- name: Setup pnpm
|
2024-07-05 10:24:11 +08:00
|
|
|
uses: pnpm/action-setup@v4
|
2022-03-11 22:56:05 +08:00
|
|
|
|
2022-05-10 19:24:16 +08:00
|
|
|
- name: Setup node
|
|
|
|
uses: actions/setup-node@v3
|
2022-03-11 22:56:05 +08:00
|
|
|
with:
|
2024-10-01 11:44:20 +08:00
|
|
|
node-version: 20
|
2022-09-22 09:04:40 +08:00
|
|
|
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
run: |
|
2022-10-27 15:17:05 +08:00
|
|
|
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
|
2022-09-22 09:04:40 +08:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Setup pnpm cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
2022-03-11 22:56:05 +08:00
|
|
|
|
|
|
|
- uses: preactjs/compressed-size-action@v2
|
|
|
|
with:
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
pattern: './dist/element-plus/dist/*.{js,mjs,css}'
|
2022-06-08 16:44:18 +08:00
|
|
|
env:
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|