chore: Upgrade deprecated parts of bundle analysis (#13104)
* chore: Upgrade deprecated parts of bundle analysis * Added workflow_dispatch to allow for manual runs * Removed conditions just for testing
This commit is contained in:
parent
5690718e7f
commit
7dc7f949cf
|
@ -2,6 +2,7 @@ name: "Next.js Bundle Analysis"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
@ -34,7 +35,7 @@ jobs:
|
||||||
|
|
||||||
- name: Download base branch bundle stats
|
- name: Download base branch bundle stats
|
||||||
uses: dawidd6/action-download-artifact@v2
|
uses: dawidd6/action-download-artifact@v2
|
||||||
if: success() && github.event.number
|
if: success()
|
||||||
with:
|
with:
|
||||||
workflow: nextjs-bundle-analysis.yml
|
workflow: nextjs-bundle-analysis.yml
|
||||||
branch: ${{ github.event.pull_request.base.ref }}
|
branch: ${{ github.event.pull_request.base.ref }}
|
||||||
|
@ -54,39 +55,39 @@ jobs:
|
||||||
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
|
# Either of these arguments can be changed or removed by editing the `nextBundleAnalysis`
|
||||||
# entry in your package.json file.
|
# entry in your package.json file.
|
||||||
- name: Compare with base branch bundle
|
- name: Compare with base branch bundle
|
||||||
if: success() && github.event.number
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
cd apps/web
|
cd apps/web
|
||||||
ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
|
ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
|
||||||
|
|
||||||
- name: Get comment body
|
- name: Get comment body
|
||||||
id: get-comment-body
|
id: get-comment-body
|
||||||
if: success() && github.event.number
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
cd apps/web
|
cd apps/web
|
||||||
body=$(cat .next/analyze/__bundle_analysis_comment.txt)
|
body=$(cat .next/analyze/__bundle_analysis_comment.txt)
|
||||||
body="${body//'%'/'%25'}"
|
body="${body//'%'/'%25'}"
|
||||||
body="${body//$'\n'/'%0A'}"
|
body="${body//$'\n'/'%0A'}"
|
||||||
body="${body//$'\r'/'%0D'}"
|
body="${body//$'\r'/'%0D'}"
|
||||||
echo ::set-output name=body::$body
|
echo "{name}={$body}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v1
|
uses: peter-evans/find-comment@v2
|
||||||
if: success() && github.event.number
|
if: success()
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
body-includes: "<!-- __NEXTJS_BUNDLE_@calcom/web -->"
|
body-includes: "<!-- __NEXTJS_BUNDLE_@calcom/web -->"
|
||||||
|
|
||||||
- name: Create Comment
|
- name: Create Comment
|
||||||
uses: peter-evans/create-or-update-comment@v1.4.4
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
|
if: success() && github.event.number && steps.fc.outputs.comment-id == 0
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
body: ${{ steps.get-comment-body.outputs.body }}
|
body: ${{ steps.get-comment-body.outputs.body }}
|
||||||
|
|
||||||
- name: Update Comment
|
- name: Update Comment
|
||||||
uses: peter-evans/create-or-update-comment@v1.4.4
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
|
if: success() && github.event.number && steps.fc.outputs.comment-id != 0
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user