mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge pull request #5365 from aloisklink/ci/stop-commenting-size-diff-in-PRs
ci(e2e): avoid commenting on PRs in CI, fixing PRs from forks
This commit is contained in:
commit
4884b01b8a
27
.github/workflows/e2e.yml
vendored
27
.github/workflows/e2e.yml
vendored
@ -15,7 +15,6 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
|
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
|
||||||
@ -56,8 +55,8 @@ jobs:
|
|||||||
# just perform install
|
# just perform install
|
||||||
runTests: false
|
runTests: false
|
||||||
|
|
||||||
- name: Build
|
- name: Calculate bundle size
|
||||||
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' && github.event_name == 'pull_request' }}
|
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true'}}
|
||||||
run: |
|
run: |
|
||||||
pnpm run build:viz
|
pnpm run build:viz
|
||||||
mkdir -p cypress/snapshots/stats/base
|
mkdir -p cypress/snapshots/stats/base
|
||||||
@ -107,26 +106,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
runTests: false
|
runTests: false
|
||||||
|
|
||||||
- name: Build
|
- name: Output size diff
|
||||||
id: size
|
if: ${{ matrix.containers == 1 }}
|
||||||
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 '## Bundle size difference' >> "$GITHUB_STEP_SUMMARY"
|
||||||
echo 'size_diff<<EOF'
|
echo '' >> "$GITHUB_STEP_SUMMARY"
|
||||||
npx tsx scripts/size.ts
|
npx tsx scripts/size.ts >> "$GITHUB_STEP_SUMMARY"
|
||||||
echo EOF
|
|
||||||
} >> "$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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user