Skip to content

Commit

Permalink
Feat: Calculate package size change on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Jan 24, 2024
1 parent 0f02f5f commit e0448a7
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,21 @@ jobs:
runTests: false

- name: Build
if: ${{ github.event_name == 'pull_request' }}
id: size
if: ${{ github.event_name == 'pull_request' && matrix.containers == 1 }}
run: |
pnpm run build:viz
mv stats cypress/snapshots/stats/head
echo "size_diff=$(npx tsx scripts/size.ts)" >> $GITHUB_OUTPUT
# Size diff only needs to be posted from one job, on PRs.
- name: Comment PR size difference
if: ${{ github.event_name == 'pull_request' && matrix.containers == 1 }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
${{ steps.size.outputs.size_diff }}
comment_tag: size-diff

# Install NPM dependencies, cache them correctly
# and run all Cypress tests
Expand Down Expand Up @@ -164,19 +175,6 @@ jobs:
pattern: snapshots-*
merge-multiple: true

- name: Calculate Size difference
id: size
if: ${{ github.event_name == 'pull_request' }}
run: echo "::set-output name=size_diff::$(npx tsx scripts/size.ts)"

- name: Comment PR size difference
if: ${{ github.event_name == 'pull_request' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
${{ steps.size.outputs.size_diff }}
comment_tag: size-diff

# For successful push events, we save the snapshots cache
- name: Save snapshots cache
id: cache-upload
Expand Down

0 comments on commit e0448a7

Please sign in to comment.