Introduce asset size check action to CI (#47880)
This commit is contained in:
parent
0606b9580b
commit
de5d73061d
|
@ -0,0 +1,42 @@
|
||||||
|
name: Compressed Size
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**.jsx?'
|
||||||
|
- '**.tsx?'
|
||||||
|
- '**.css'
|
||||||
|
- '**.scss'
|
||||||
|
- '**package*.json'
|
||||||
|
- '**.eslint*'
|
||||||
|
- '**.prettier*'
|
||||||
|
- '**.tsconfig*'
|
||||||
|
- '**/webpack.config.js'
|
||||||
|
- '.github/workflows/pr-assess-bundle-size.yml'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Check Asset Sizes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup WooCommerce Monorepo
|
||||||
|
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||||
|
with:
|
||||||
|
# Both install and build are handled by compressed-size-action.
|
||||||
|
install: false
|
||||||
|
build: false
|
||||||
|
- uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c
|
||||||
|
with:
|
||||||
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
pattern: './{packages/js/!(*e2e*|*internal*|*test*|*plugin*|*create*),plugins/woocommerce-blocks}/{build,build-style}/**/*.{js,css}'
|
||||||
|
clean-script: '--if-present distclean'
|
||||||
|
minimum-change-threshold: 100
|
||||||
|
omit-unchanged: true
|
|
@ -23,6 +23,7 @@
|
||||||
"lint": "pnpm -r lint",
|
"lint": "pnpm -r lint",
|
||||||
"cherry-pick": "node ./tools/cherry-pick/bin/run",
|
"cherry-pick": "node ./tools/cherry-pick/bin/run",
|
||||||
"clean": "rimraf -g '**/node_modules' '**/.wireit' && pnpm store prune && pnpm i",
|
"clean": "rimraf -g '**/node_modules' '**/.wireit' && pnpm store prune && pnpm i",
|
||||||
|
"distclean": "git clean --force -d -X",
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
"postinstall": "pnpm git:update-hooks",
|
"postinstall": "pnpm git:update-hooks",
|
||||||
"git:update-hooks": "if test -d .git; then rm -rf .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
|
"git:update-hooks": "if test -d .git; then rm -rf .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
|
||||||
|
|
Loading…
Reference in New Issue