Skip to content

Commit 237c1e0

Browse files
Compare sizes with main (#1679)
* Compare sizes wiht main * try this * PRint out remotes * PRint out remotes
1 parent 04e0de0 commit 237c1e0

File tree

1 file changed

+63
-3
lines changed

1 file changed

+63
-3
lines changed

.github/workflows/size.yml

+63-3
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,25 @@ env:
1919
TURBO_TEAM: myself
2020

2121
jobs:
22-
install_dependencies:
23-
name: 'Setup'
22+
compare_sizes:
23+
name: 'Compare Sizes and Comment'
2424
runs-on: 'ubuntu-latest'
2525

2626
steps:
27+
- name: '[DEBUG] Dump GitHub context'
28+
env:
29+
GITHUB_CONTEXT: ${{ toJson(github) }}
30+
run: echo "$GITHUB_CONTEXT"
31+
2732
- uses: wyvox/action@v1
2833
with:
2934
pnpm-args: '--ignore-scripts'
30-
node-version: 20.1.0
3135
repo-token: ${{ secrets.GITHUB_TOKEN }}
3236
ref: ${{ inputs.BRANCH }}
37+
3338
- run: pnpm turbo build
3439
- run: sudo snap install dust
40+
3541
- name: "Get sizes for development outputs"
3642
id: dev
3743
run: |
@@ -64,6 +70,47 @@ jobs:
6470
echo 'EOF' >> $GITHUB_OUTPUT
6571
cat out.txt
6672
73+
- name: "Get sizes from the main branch"
74+
run: |
75+
git remote -v
76+
git fetch origin
77+
git checkout main
78+
git clean -Xfd
79+
pnpm install
80+
pnpm turbo build
81+
82+
- name: "[Main] Get sizes for development outputs"
83+
id: main-dev
84+
run: |
85+
cd packages/\@glimmer
86+
dust --ignore_hidden \
87+
--reverse --apparent-size \
88+
--filter ".+\/dist\/dev\/index.js$" \
89+
--no-percent-bars --only-dir --depth 1 > out.txt
90+
91+
echo 'sizes<<EOF' >> $GITHUB_OUTPUT
92+
while IFS= read -r line; do
93+
echo "$line" >> $GITHUB_OUTPUT
94+
done <<< $(cat out.txt)
95+
echo 'EOF' >> $GITHUB_OUTPUT
96+
cat out.txt
97+
98+
- name: "[Main] Get sizes for production outputs"
99+
id: main-prod
100+
run: |
101+
cd packages/\@glimmer
102+
dust --ignore_hidden \
103+
--reverse --apparent-size \
104+
--filter ".+\/dist\/prod\/index.js$" \
105+
--no-percent-bars --only-dir --depth 1 > out.txt
106+
107+
echo 'sizes<<EOF' >> $GITHUB_OUTPUT
108+
while IFS= read -r line; do
109+
echo "$line" >> $GITHUB_OUTPUT
110+
done <<< $(cat out.txt)
111+
echo 'EOF' >> $GITHUB_OUTPUT
112+
cat out.txt
113+
67114
- uses: mshick/add-pr-comment@v2
68115
with:
69116
message: |
@@ -81,6 +128,19 @@ jobs:
81128
${{ steps.prod.outputs.sizes }}
82129
```
83130
131+
</td></tr>
132+
<tr><td>Main</td><td>
133+
134+
```
135+
${{ steps.main-dev.outputs.sizes }}
136+
```
137+
138+
</td><td>
139+
140+
```
141+
${{ steps.main-prod.outputs.sizes }}
142+
```
143+
84144
</td></tr>
85145
</tbody></table>
86146

0 commit comments

Comments
 (0)