Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: compare bundle size #3661

Merged
merged 7 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ jobs:
path: coverage/

perf-measures-type-check-on-pr:
name: 'Type Check on PR'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
Expand Down Expand Up @@ -209,6 +210,7 @@ jobs:
name: display comparison

perf-measures-type-check-on-main:
name: 'Type Check on Main'
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
Expand All @@ -223,3 +225,44 @@ jobs:
with:
path: perf-measures/type-check/previous-result.txt
key: type-check-perf-previous-result-${{ github.sha }}

perf-measures-bundle-check-on-pr:
name: 'Bundle Check on PR'
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Comment on lines +229 to +232
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Does the bundle size change every time?
Or does it change only when a specific file is changed?

Should I integrate workflow jobs when importing into #3491? Should we keep them separate? I am pondering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Does the bundle size change every time?
Or does it change only when a specific file is changed?

it change only when a specific file is changed is right.

Only when a core file is changed.

Should I integrate workflow jobs when importing into #3491? Should we keep them separate? I am pondering.

I have limited knowledge about it, sorry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to run a job only when a core file is changed, can I identify the core file?
Also, will the number of target core file types increase or decrease frequently?

Copy link
Contributor Author

@EdamAme-x EdamAme-x Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there will be little or no increase or decrease in the core file.
So it is a good idea to measure when it should be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to keep this as a TODO/NOTE as it seems a bit difficult to implement.

https://stackoverflow.com/questions/70708306/github-actions-run-step-job-in-a-workflow-if-changes-happen-in-specific-folde

steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
- run: bunx esbuild --minify --bundle dist/index.js --format=esm --outfile=perf-measures/bundle-check/generated/after.js
- uses: actions/cache/restore@v4
with:
path: perf-measures/bundle-check/generated/before.js
restore-keys: |
perf-measures-bundle-check-previous-file-
key: perf-measures-bundle-check-previous-file-
- run: |
{
echo 'COMPARISON<<EOF'
ls -l ./generated | column -s '|' -t
EdamAme-x marked this conversation as resolved.
Show resolved Hide resolved
echo 'EOF'
} >> "$GITHUB_ENV"
working-directory: perf-measures/bundle-check
- run: echo "$COMPARISON"
name: display comparison

perf-measures-bundle-check-on-main:
name: 'Bundle Check on Main'
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
- run: bunx esbuild --minify --bundle dist/index.js --format=esm --outfile=perf-measures/bundle-check/generated/before.js
- uses: actions/cache/save@v4
with:
path: perf-measures/bundle-check/generated/before.js
key: perf-measures-bundle-check-previous-file-${{ github.sha }}
EdamAme-x marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Loading