Skip to content

Commit

Permalink
Add configurable size limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Oct 30, 2024
1 parent 7730579 commit 8993970
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ jobs:
target_file: 'packages/sdk/browser/dist/index.js'
package_name: '@launchdarkly/js-client-sdk'
pr_number: ${{ github.event.number }}
size_limit: 21000
1 change: 1 addition & 0 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
target_file: 'packages/shared/common/dist/esm/index.mjs'
package_name: '@launchdarkly/js-sdk-common'
pr_number: ${{ github.event.number }}
size_limit: 21000
1 change: 1 addition & 0 deletions .github/workflows/sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
target_file: 'packages/shared/sdk-client/dist/esm/index.mjs'
package_name: '@launchdarkly/js-client-sdk-common'
pr_number: ${{ github.event.number }}
size_limit: 20000
9 changes: 7 additions & 2 deletions actions/package-size/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ inputs:
description: 'The name of the package'
required: true
pr_number:
description: 'Th PR number'
description: 'The PR number'
required: true
size_limit:
description: 'The maximum size of the library'
required: true
runs:
using: composite
Expand Down Expand Up @@ -44,6 +47,7 @@ runs:
${{ inputs.package_name }} size report
This is the brotli compressed size of the ESM build.
Size: ${{ env.PACK_SIZE }} bytes
Size limit: ${{ inputs.size_limit }}
- name: Update comment
if: steps.fc.outputs.comment-id != ''
Expand All @@ -55,8 +59,9 @@ runs:
${{ inputs.package_name }} size report
This is the brotli compressed size of the ESM build.
Size: ${{ env.PACK_SIZE }} bytes
Size limit: ${{ inputs.size_limit }}
- name: Check package size limit
shell: bash
run: |
[ $PACK_SIZE -le 25000 ] || exit 1
[ $PACK_SIZE -le ${{ inputs.size_limit }} ] || exit 1

0 comments on commit 8993970

Please sign in to comment.