test: enable codecov bundle analysis (#50384)

This commit is contained in:
afc163 2024-08-13 13:32:17 +08:00 committed by GitHub
parent 700e0aeebe
commit 2f64ecf7a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 6 deletions

View File

@ -27,5 +27,6 @@ jobs:
env: env:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: "--max_old_space_size=4096"
PRODUCTION_ONLY: 1 PRODUCTION_ONLY: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
NO_DUP_CHECK: 1 NO_DUP_CHECK: 1
CI_JOB_NUMBER: 1 CI_JOB_NUMBER: 1

View File

@ -156,6 +156,7 @@
"@antv/g6": "^4.8.24", "@antv/g6": "^4.8.24",
"@babel/eslint-plugin": "^7.24.7", "@babel/eslint-plugin": "^7.24.7",
"@biomejs/biome": "^1.8.3", "@biomejs/biome": "^1.8.3",
"@codecov/webpack-plugin": "^0.0.1-beta.10",
"@codesandbox/sandpack-react": "^2.18.0", "@codesandbox/sandpack-react": "^2.18.0",
"@dnd-kit/core": "^6.1.0", "@dnd-kit/core": "^6.1.0",
"@dnd-kit/modifiers": "^7.0.0", "@dnd-kit/modifiers": "^7.0.0",

View File

@ -35,17 +35,13 @@
text-align: left; text-align: left;
vertical-align: top; vertical-align: top;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
width: 33%;
} }
td img { td img {
max-width: 100%; max-width: 100%;
} }
th,
td {
width: 33%;
}
th { th {
background-color: #f2f2f2; background-color: #f2f2f2;
} }

View File

@ -2,6 +2,7 @@
// This config is for building dist files // This config is for building dist files
const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig'); const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const { codecovWebpackPlugin } = require('@codecov/webpack-plugin');
const { EsbuildPlugin } = require('esbuild-loader'); const { EsbuildPlugin } = require('esbuild-loader');
const CircularDependencyPlugin = require('circular-dependency-plugin'); const CircularDependencyPlugin = require('circular-dependency-plugin');
const DuplicatePackageCheckerPlugin = require('@madccc/duplicate-package-checker-webpack-plugin'); const DuplicatePackageCheckerPlugin = require('@madccc/duplicate-package-checker-webpack-plugin');
@ -39,6 +40,15 @@ if (process.env.PRODUCTION_ONLY) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('🍐 Build production only'); console.log('🍐 Build production only');
webpackConfig = webpackConfig.filter((config) => config.mode === 'production'); webpackConfig = webpackConfig.filter((config) => config.mode === 'production');
webpackConfig.forEach((config) => {
config.plugins.push(
codecovWebpackPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: 'antd',
uploadToken: process.env.CODECOV_TOKEN,
}),
);
});
} }
if (process.env.RUN_ENV === 'PRODUCTION') { if (process.env.RUN_ENV === 'PRODUCTION') {