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

chore(ci/pr): print size of respec-w3c #3398

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 3 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
5 changes: 5 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
run: |
npm ci
npm run build:w3c
- name: Size of respec-w3c
run: |
npx -q brrr builds/respec-w3c.js -o builds
Copy link
Contributor

Choose a reason for hiding this comment

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

This is very cute, but it would be more cute 🐨 if it showed in comparison to the old build... otherwise, it doesn't mean much, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would require building twice..
There's https://github.com/preactjs/compressed-size-action to do the heavy lifting, but only tells of compressed size. I'm interested in both compressed and uncompressed. I might create an action for that maybe 🐱

Copy link
Contributor

Choose a reason for hiding this comment

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

That would require building twice...

Hmm... could we look at sizes before "npm run build:w3c" runs, then store them somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Building adds like 3-4 seconds, so I think might be okay to be build twice.
Storing adds its own maintenance issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

Building adds like 3-4 seconds, so I think might be okay to be build twice.

Yeah, that's fine. It's only for us, after all.

Storing adds its own maintenance issues.

Oh, I was thinking just a simple environment variable, like:

ORIGINAL_BUILD_SIZE=$(stat -f%z builds/respec-w3c.js)

Just for quick comparison.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be comparing to previous release. I'm interested in comparing since last commit to base branch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unless you mean comparing size with the one we just built in previous step, which is something I'll do when I create that action.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok cool.

gzip -k builds/respec-w3c.js
stat -c "%6s %n" builds/respec-w3c.js*
- run: npm run test:headless

test-karma:
Expand Down