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

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

wants to merge 7 commits into from

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Mar 22, 2021

It'll show up in "headless tests" step:
image

@sidvishnoi sidvishnoi marked this pull request as ready for review March 22, 2021 12:31
@@ -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
Member

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
Member

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
Member

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
Member

Choose a reason for hiding this comment

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

Ok cool.

@sidvishnoi sidvishnoi added the Low priority Suggestions with no good driving force label Mar 23, 2021
@sidvishnoi sidvishnoi marked this pull request as draft March 23, 2021 10:50
@sidvishnoi
Copy link
Member Author

Will build an action later based on:

- name: Get current size
id: current-size
run: |
npm ci
npm run build:w3c
gzip -k builds/respec-w3c.js
stat -c "%6s %n" builds/respec-w3c.js*
git clean -fd && git checkout -- .
- name: Get base size
id: base-size
run: |
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}
git checkout ${{ github.base_ref }}
npm ci
npm run build:w3c
gzip -k builds/respec-w3c.js
stat -c "%6s %n" builds/respec-w3c.js*
git clean -fd && git checkout -- .
git checkout -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONT MERGE Low priority Suggestions with no good driving force
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants