Skip to content

fix typo in autoroutingCacheEnabled, add subcircuit_id to output source_trace and source_port #688

fix typo in autoroutingCacheEnabled, add subcircuit_id to output source_trace and source_port

fix typo in autoroutingCacheEnabled, add subcircuit_id to output source_trace and source_port #688

Workflow file for this run

name: Size
on:
pull_request:
branches: [main]
paths:
- 'package.json'
- 'bun.lockb'
- '.github/workflows/bundle-size-analysis.yml'
permissions:
pull-requests: write
jobs:
size:
name: Report bundle and install size
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout base branch
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies (base)
run: bun install
- name: Build (base)
run: bun run build
- name: Get base bundle size
id: base-bundle-size
run: |
echo "base=$(du -sk dist | cut -f1)" >> $GITHUB_OUTPUT
- name: Get base install size
id: base-install-size
run: |
echo "base=$(bunx howfat -r simple . | grep 'Size:' | awk '{print $2}' | sed 's/K//')" >> $GITHUB_OUTPUT
- name: Checkout PR branch
uses: actions/checkout@v3
- name: Install dependencies (PR)
run: bun install
- name: Build (PR)
run: bun run build
- name: Get PR bundle size
id: pr-bundle-size
run: |
echo "pr=$(du -sk dist | cut -f1)" >> $GITHUB_OUTPUT
- name: Get PR install size and full howfat output
id: pr-install-size
run: |
echo "pr=$(bunx howfat -r simple . | grep 'Size:' | awk '{print $2}' | sed 's/K//')" >> $GITHUB_OUTPUT
echo "full_output<<EOF" >> $GITHUB_OUTPUT
bunx howfat -r table . >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Calculate bundle size difference
id: bundle-size-diff
run: |
base_size=${{ steps.base-bundle-size.outputs.base }}
pr_size=${{ steps.pr-bundle-size.outputs.pr }}
diff=$((pr_size - base_size))
echo "diff=$diff" >> $GITHUB_OUTPUT
- name: Calculate install size difference
id: install-size-diff
run: |
base_size=${{ steps.base-install-size.outputs.base }}
pr_size=${{ steps.pr-install-size.outputs.pr }}
diff=$(echo "$pr_size - $base_size" | bc)
echo "diff=$diff" >> $GITHUB_OUTPUT
- name: Conditionally Update PR Comment
if: |

Check failure on line 85 in .github/workflows/bundle-size.yml

View workflow run for this annotation

GitHub Actions / Size

Invalid workflow file

The workflow is not valid. .github/workflows/bundle-size.yml (Line: 85, Col: 13): Unexpected symbol: '|'. Located at position 37 within expression: steps.bundle-size-diff.outputs.diff | tonumber >= 10 or steps.bundle-size-diff.outputs.diff | tonumber <= -10 or steps.install-size-diff.outputs.diff | tonumber >= 10 or steps.install-size-diff.outputs.diff | tonumber <= -10
steps.bundle-size-diff.outputs.diff | tonumber >= 10
or steps.bundle-size-diff.outputs.diff | tonumber <= -10
or steps.install-size-diff.outputs.diff | tonumber >= 10
or steps.install-size-diff.outputs.diff | tonumber <= -10
uses: mshick/add-pr-comment@v2
env:
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
with:
header: Size Report
message: |
## Size Report
### Bundle Size
- Base branch size: ${{ steps.base-bundle-size.outputs.base }} KB
- PR branch size: ${{ steps.pr-bundle-size.outputs.pr }} KB
- Difference: ${{ steps.bundle-size-diff.outputs.diff }} KB
### Install Size
- Base branch size: ${{ steps.base-install-size.outputs.base }} KB
- PR branch size: ${{ steps.pr-install-size.outputs.pr }} KB
- Difference: ${{ steps.install-size-diff.outputs.diff }} KB
### Full Howfat Output (PR Branch)
```
${{ steps.pr-install-size.outputs.full_output }}
(aside)
```
proxy-url: https://add-pr-comment-proxy-tscircuit.vercel.app/api
allow-repeats: false