chore: fix size-limit action (#39268)

* chore: fix size-limit action

* Update .github/workflows/size-limit.yml

* Apply suggestions from code review

* Apply suggestions from code review
This commit is contained in:
afc163 2022-12-05 21:32:10 +08:00 committed by GitHub
parent c9d8b89e25
commit 6614faee50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 41 deletions

View File

@ -1,31 +0,0 @@
name: 📦 Compressed Size
on:
pull_request:
types: [opened, synchronize]
# Cancel prev CI if new commit come
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
compressed-size:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # for preactjs/compressed-size-action to create PR comments
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: "./dist/**/*.min.{js,css}"
build-script: "dist:esbuild-no-dup-check"
clean-script: "clean-lockfiles"

View File

@ -1,4 +1,4 @@
name: 📦 Compressed Size(size-limit)
name: 📦 Size Limit
on:
pull_request:
@ -13,10 +13,10 @@ permissions:
contents: read
jobs:
compressed-size:
size:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: write # for preactjs/compressed-size-action to create PR comments
contents: read
pull-requests: write
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
@ -25,7 +25,5 @@ jobs:
- uses: actions/checkout@v3
- uses: andresz1/size-limit-action@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: "./dist/**/*.min.{js,css}"
build-script: "dist:esbuild-no-dup-check"
clean-script: "clean-lockfiles"
github_token: ${{ secrets.GITHUB_TOKEN }}
script: npx size-limit --json --why

View File

@ -167,6 +167,7 @@
"@emotion/server": "^11.4.0",
"@qixian.cs/github-contributors-list": "^1.0.3",
"@size-limit/file": "^8.0.0",
"@size-limit/preset-big-lib": "^8.1.0",
"@stackblitz/sdk": "^1.3.0",
"@testing-library/dom": "^8.17.1",
"@testing-library/jest-dom": "^5.16.3",
@ -316,13 +317,17 @@
"size-limit": [
{
"path": "./dist/antd.min.js",
"limit": "375 kB"
"limit": "390 kB"
},
{
"path": "./dist/antd-with-locales.min.js",
"limit": "450 kB"
}
],
"bundlesize": [
{
"path": "./dist/antd.min.js",
"maxSize": "377.5 kB"
"maxSize": "377 kB"
}
],
"tnpm": {