Skip to content

Commit a3dd754

Browse files
committed
ci: Re-add size limit action
add description reorder stuff use old version of artifacts fix dirname fix bump node version fix cwd? skip nextjs for now update limits better log? fix trim it fix size limit creation really fix command?
1 parent b9b4cb2 commit a3dd754

File tree

8 files changed

+773
-93
lines changed

8 files changed

+773
-93
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,34 @@ jobs:
278278
# `job_build` can't see `job_install_deps` and what it returned)
279279
dependency_cache_key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
280280

281+
job_size_check:
282+
name: Size Check
283+
needs: [job_get_metadata, job_build]
284+
timeout-minutes: 15
285+
runs-on: ubuntu-20.04
286+
if:
287+
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_develop == 'true' ||
288+
needs.job_get_metadata.outputs.is_release == 'true'
289+
steps:
290+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
291+
uses: actions/checkout@v4
292+
with:
293+
ref: ${{ env.HEAD_COMMIT }}
294+
- name: Set up Node
295+
uses: actions/setup-node@v4
296+
with:
297+
node-version-file: 'package.json'
298+
- name: Restore caches
299+
uses: ./.github/actions/restore-cache
300+
env:
301+
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
302+
- name: Check bundle sizes
303+
uses: ./dev-packages/size-limit-gh-action
304+
with:
305+
github_token: ${{ secrets.GITHUB_TOKEN }}
306+
# Only run comparison against develop if this is a PR
307+
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
308+
281309
job_lint:
282310
name: Lint
283311
# Even though the linter only checks source code, not built code, it needs the built code in order check that all

.size-limit.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ module.exports = [
4545
path: 'packages/browser/build/npm/esm/index.js',
4646
import: '{ init, browserTracingIntegration }',
4747
gzip: true,
48-
limit: '35 KB',
48+
limit: '90 KB',
4949
},
5050
{
5151
name: '@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped)',
5252
path: 'packages/browser/build/npm/esm/index.js',
5353
import: '{ init, browserTracingIntegration }',
5454
gzip: true,
55-
limit: '35 KB',
55+
limit: '90 KB',
5656
},
5757
{
5858
name: '@sentry/browser (incl. feedbackIntegration) - Webpack (gzipped)',
5959
path: 'packages/browser/build/npm/esm/index.js',
6060
import: '{ init, feedbackIntegration }',
6161
gzip: true,
62-
limit: '50 KB',
62+
limit: '90 KB',
6363
},
6464
{
6565
name: '@sentry/browser (incl. feedbackModalIntegration) - Webpack (gzipped)',
@@ -80,14 +80,14 @@ module.exports = [
8080
path: 'packages/browser/build/npm/esm/index.js',
8181
import: '{ init, sendFeedback }',
8282
gzip: true,
83-
limit: '50 KB',
83+
limit: '90 KB',
8484
},
8585
{
8686
name: '@sentry/browser - Webpack (gzipped)',
8787
path: 'packages/browser/build/npm/esm/index.js',
8888
import: '{ init }',
8989
gzip: true,
90-
limit: '28 KB',
90+
limit: '90 KB',
9191
},
9292

9393
// Browser CDN bundles
@@ -107,13 +107,13 @@ module.exports = [
107107
name: '@sentry/browser (incl. Tracing) - CDN Bundle (gzipped)',
108108
path: 'packages/browser/build/bundles/bundle.tracing.min.js',
109109
gzip: true,
110-
limit: '37 KB',
110+
limit: '40 KB',
111111
},
112112
{
113113
name: '@sentry/browser - CDN Bundle (gzipped)',
114114
path: 'packages/browser/build/bundles/bundle.min.js',
115115
gzip: true,
116-
limit: '28 KB',
116+
limit: '30 KB',
117117
},
118118

119119
// browser CDN bundles (non-gzipped)
@@ -129,7 +129,7 @@ module.exports = [
129129
path: 'packages/browser/build/bundles/bundle.tracing.min.js',
130130
gzip: false,
131131
brotli: false,
132-
limit: '105 KB',
132+
limit: '120 KB',
133133
},
134134
{
135135
name: '@sentry/browser - CDN Bundle (minified & uncompressed)',
@@ -145,18 +145,19 @@ module.exports = [
145145
path: 'packages/react/build/esm/index.js',
146146
import: '{ init, browserTracingIntegration, replayIntegration }',
147147
gzip: true,
148-
limit: '75 KB',
148+
limit: '90 KB',
149149
},
150150
{
151151
name: '@sentry/react - Webpack (gzipped)',
152152
path: 'packages/react/build/esm/index.js',
153153
import: '{ init }',
154154
gzip: true,
155-
limit: '30 KB',
155+
limit: '90 KB',
156156
},
157157

158158
// Next.js
159-
{
159+
// TODO: Re-enable these, when we figure out why they break...
160+
/* {
160161
name: '@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped)',
161162
path: 'packages/nextjs/build/esm/client/index.js',
162163
import: '{ init, browserTracingIntegration, replayIntegration }',
@@ -169,12 +170,5 @@ module.exports = [
169170
import: '{ init }',
170171
gzip: true,
171172
limit: '57 KB',
172-
},
173-
{
174-
name: '@sentry-internal/feedback - Webpack (gzipped)',
175-
path: 'packages/feedback/build/npm/esm/index.js',
176-
import: '{ feedbackIntegration }',
177-
gzip: true,
178-
limit: '25 KB',
179-
},
173+
}, */
180174
];
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
extends: ['../../.eslintrc.js'],
3+
parserOptions: {
4+
sourceType: 'module',
5+
ecmaVersion: 'latest',
6+
},
7+
8+
overrides: [
9+
{
10+
files: ['*.mjs'],
11+
extends: ['@sentry-internal/sdk/src/base'],
12+
},
13+
],
14+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'size-limit-gh-action'
2+
description: 'Run size-limit comparison'
3+
inputs:
4+
github_token:
5+
required: true
6+
description: 'a github access token'
7+
comparison_branch:
8+
required: false
9+
default: ""
10+
description: "If set, compare the current branch with this branch"
11+
threshold:
12+
required: false
13+
default: "0.0125"
14+
description: "The percentage threshold for size changes before posting a comment"
15+
runs:
16+
using: 'node20'
17+
main: 'index.mjs'

0 commit comments

Comments
 (0)