mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
ci(project): compressed actions for PRs (#6547)
* ci(project): compressed actions for PRs - Introduce compressed size checking action for PRs - Update package.json with a clean:lockfile script for the action * Fix pnpm not found
This commit is contained in:
41
.github/workflows/size-report.yml
vendored
Normal file
41
.github/workflows/size-report.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: 📦 Package Size Report
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
size-report:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CI_JOB_NUMBER: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Cache ~/.pnpm-store
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-pnpm-store
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-publish-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-publish-${{ env.cache-name }}-
|
||||
${{ runner.os }}-publish-
|
||||
${{ runner.os }}-
|
||||
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pattern: './dist/element-plus/dist/*.{js,mjs,css}'
|
||||
clean-script: 'clean:lockfile'
|
||||
@@ -24,6 +24,7 @@
|
||||
"update:version": "sucrase-node scripts/update-version.ts",
|
||||
"clean": "pnpm run clean:dist && pnpm run clean -r --stream",
|
||||
"clean:dist": "rimraf dist",
|
||||
"clean:lockfile": "rm -f pnpm-lock.yaml",
|
||||
"build": "gulp --require sucrase/register/ts -f build/gulpfile.ts",
|
||||
"build:theme": "pnpm run build -C packages/theme-chalk",
|
||||
"format": "prettier --write .",
|
||||
|
||||
Reference in New Issue
Block a user