Skip to content

Commit

Permalink
Compare sizes wiht main
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jan 15, 2025
1 parent 04e0de0 commit 2cf2581
Showing 1 changed file with 56 additions and 3 deletions.
59 changes: 56 additions & 3 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ env:
TURBO_TEAM: myself

jobs:
install_dependencies:
name: 'Setup'
compare_sizes:
name: 'Compare Sizes and Comment'
runs-on: 'ubuntu-latest'

steps:
- uses: wyvox/action@v1
with:
pnpm-args: '--ignore-scripts'
node-version: 20.1.0
repo-token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.BRANCH }}

- run: pnpm turbo build
- run: sudo snap install dust

- name: "Get sizes for development outputs"
id: dev
run: |
Expand Down Expand Up @@ -64,6 +65,45 @@ jobs:
echo 'EOF' >> $GITHUB_OUTPUT
cat out.txt
- name: "Get sizes from the main branch"
run: |
git checkout main
git clean -Xfd
pnpm install
pnpm turbo build
- name: "[Main] Get sizes for development outputs"
id: main-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: "[Main] Get sizes for production outputs"
id: main-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: |
Expand All @@ -81,6 +121,19 @@ jobs:
${{ steps.prod.outputs.sizes }}
```
</td></tr>
<tr><td>Main</td><td>
```
${{ steps.main-dev.outputs.sizes }}
```
</td><td>
```
${{ steps.main-prod.outputs.sizes }}
```
</td></tr>
</tbody></table>
Expand Down

0 comments on commit 2cf2581

Please sign in to comment.