mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-17 15:29:25 +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
|
runTests: false
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
id: size
|
||||||
|
if: ${{ github.event_name == 'pull_request' && matrix.containers == 1 }}
|
||||||
run: |
|
run: |
|
||||||
pnpm run build:viz
|
pnpm run build:viz
|
||||||
mv stats cypress/snapshots/stats/head
|
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
|
# Install NPM dependencies, cache them correctly
|
||||||
# and run all Cypress tests
|
# and run all Cypress tests
|
||||||
@@ -164,19 +175,6 @@ jobs:
|
|||||||
pattern: snapshots-*
|
pattern: snapshots-*
|
||||||
merge-multiple: true
|
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
|
# For successful push events, we save the snapshots cache
|
||||||
- name: Save snapshots cache
|
- name: Save snapshots cache
|
||||||
id: cache-upload
|
id: cache-upload
|
||||||
|
Reference in New Issue
Block a user