Skip to content

chore(deps): bump @aws-amplify/amplify-cli-core from 4.3.6 to 4.3.9 #9

chore(deps): bump @aws-amplify/amplify-cli-core from 4.3.6 to 4.3.9

chore(deps): bump @aws-amplify/amplify-cli-core from 4.3.6 to 4.3.9 #9

name: Check Bundle Size
on:
pull_request:
branches: [main]
jobs:
checkBundleSizeChange:
permissions:
pull-requests: read
name: Check whether PR increases bundle size more than 5%
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: main
- name: Setup Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Install dependencies
run: yarn
- name: Run build and analyze base bundle sizes
env:
CURRENT_BRANCH: ${{ github.base_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check base bundle size of select pages
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: base-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Checkout PR branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Install dependencies
run: yarn
- name: Run build and analyze head bundle sizes
env:
CURRENT_BRANCH: ${{ github.head_ref }}
CURRENT_REPO: ${{ github.repository }}
NODE_OPTIONS: --max_old_space_size=4096
run: ANALYZE=true yarn next-build
- name: Check head bundle size of select pages
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: head-bundle-sizes
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { checkBundleSize } = require('./.github/workflows/scripts/check_bundle_size.js');
return checkBundleSize();
- name: Compare bundle page bundle sizes
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: compare-bundles
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { compareBundles } = require('./.github/workflows/scripts/check_bundle_size.js');
const baseBundles = ${{ steps.base-bundle-sizes.outputs.result }}
const headBundles = ${{ steps.head-bundle-sizes.outputs.result }}
return await compareBundles(baseBundles, headBundles)
- name: Fail if bundle size growth exceeds 5% on any of the selected pages
if: ${{ steps.compare-bundles.outputs.result > 0 }}
run: exit 1