From e2bd3ebd9a0e72f8372900dc36d50d645c3bcd56 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:51:23 -0500 Subject: [PATCH] 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 --- .github/workflows/size.yml | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/size.yml diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml new file mode 100644 index 000000000..a542b1e57 --- /dev/null +++ b/.github/workflows/size.yml @@ -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<> $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<> $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: | + + + +
DevProd
This PR + + ``` + ${{ steps.dev.outputs.sizes }} + ``` + + + + ``` + ${{ steps.prod.outputs.sizes }} + ``` + +
+ + + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +