Browse Source

chore: improve size-limit-action (#39319)

* Update size-limit.yml

* Update size-limit.yml

* Update size-limit.yml

* Update package.json

* Update size-limit.yml

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update size-limit.yml

* Update size-limit.yml

* Update size-limit.yml
pull/39329/head
afc163 2 years ago
committed by GitHub
parent
commit
df41ff73a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      .github/workflows/size-limit.yml
  2. 5
      package.json

42
.github/workflows/size-limit.yml

@ -22,7 +22,41 @@ jobs:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v3
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: checkout
uses: actions/checkout@v3
- name: cache package-lock.json
uses: actions/cache@v3
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: create package-lock.json
run: npm i --package-lock-only --ignore-scripts
- name: hack for single file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
- name: size-limit
uses: ant-design/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: dist
skip_step: install
env:
NODE_OPTIONS: --max_old_space_size=4096

5
package.json

@ -167,7 +167,6 @@
"@emotion/server": "^11.4.0",
"@qixian.cs/github-contributors-list": "^1.0.3",
"@size-limit/file": "^8.1.0",
"@size-limit/webpack-why": "^8.1.0",
"@stackblitz/sdk": "^1.3.0",
"@testing-library/dom": "^8.17.1",
"@testing-library/jest-dom": "^5.16.3",
@ -312,11 +311,11 @@
"size-limit": [
{
"path": "./dist/antd.min.js",
"limit": "390 kB"
"limit": "377 KiB"
},
{
"path": "./dist/antd-with-locales.min.js",
"limit": "450 kB"
"limit": "430 KiB"
}
],
"bundlesize": [

Loading…
Cancel
Save