-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Measure sizes and post as a comment (#1641)
* Measure sizes * Measure sizes * Measure sizes * Measure sizes * Measure sizes * use EOF * use EOF * use EOF * use EOF * use EOF * use EOF * use EOF * use EOF * use EOF * oops, dev and prod were backwards
- Loading branch information
1 parent
e02e42b
commit e2bd3eb
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Size | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
|
||
env: | ||
TURBO_API: http://127.0.0.1:9080 | ||
TURBO_TOKEN: this-is-not-a-secret | ||
TURBO_TEAM: myself | ||
|
||
jobs: | ||
install_dependencies: | ||
name: 'Setup' | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: wyvox/action@v1 | ||
with: | ||
pnpm-args: '--ignore-scripts' | ||
node-version: 20.1.0 | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: pnpm turbo build | ||
- run: sudo snap install dust | ||
- name: "Get sizes for development outputs" | ||
id: dev | ||
run: | | ||
cd packages/\@glimmer | ||
dust --ignore_hidden \ | ||
--reverse --apparent-size \ | ||
--filter ".+\/dist\/dev\/index.js$" \ | ||
--no-percent-bars --only-dir --depth 1 > out.txt | ||
echo 'sizes<<EOF' >> $GITHUB_OUTPUT | ||
while IFS= read -r line; do | ||
echo "$line" >> $GITHUB_OUTPUT | ||
done <<< $(cat out.txt) | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
cat out.txt | ||
- name: "Get sizes for production outputs" | ||
id: prod | ||
run: | | ||
cd packages/\@glimmer | ||
dust --ignore_hidden \ | ||
--reverse --apparent-size \ | ||
--filter ".+\/dist\/prod\/index.js$" \ | ||
--no-percent-bars --only-dir --depth 1 > out.txt | ||
echo 'sizes<<EOF' >> $GITHUB_OUTPUT | ||
while IFS= read -r line; do | ||
echo "$line" >> $GITHUB_OUTPUT | ||
done <<< $(cat out.txt) | ||
echo 'EOF' >> $GITHUB_OUTPUT | ||
cat out.txt | ||
- uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
<table><thead><tr><th></th><th>Dev</th><th>Prod</th></tr></thead> | ||
<tbody> | ||
<tr><td>This PR</td><td> | ||
``` | ||
${{ steps.dev.outputs.sizes }} | ||
``` | ||
</td><td> | ||
``` | ||
${{ steps.prod.outputs.sizes }} | ||
``` | ||
</td></tr> | ||
</tbody></table> | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|