mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Feat: Calculate package size change on PRs
This commit is contained in:
26
.github/workflows/e2e.yml
vendored
26
.github/workflows/e2e.yml
vendored
@@ -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
|
||||
@@ -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
|
||||
|
Reference in New Issue
Block a user