fix: improve sd-video a11y #2955
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: File Size Check | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
permissions: write-all | |
jobs: | |
file_size_check: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.2 | |
run_install: false | |
- name: Install dependencies | |
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true pnpm i | |
- name: build | |
run: cd packages/components && pnpm build/components | |
- name: Calculate package size | |
id: calc_size | |
run: | | |
UNCOMPRESSED=$(cd packages/components && node -e "import('./scripts/node-get-sizes.mjs').then(({ getOutputs }) => { console.log(getOutputs().uncompressed.replace('Bundle size (uncompressed): ', '')); });") | |
echo "::set-output name=uncompressed_size::$UNCOMPRESSED" | |
GZIP=$(cd packages/components && node -e "import('./scripts/node-get-sizes.mjs').then(({ getOutputs }) => { console.log(getOutputs().gzip.replace('Bundle size (gzipped): ', '')); });") | |
echo "::set-output name=gzip_size::$GZIP" | |
- name: Uncompressed | |
uses: LouisBrunner/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: uncompressed | |
conclusion: ${{ job.status }} | |
output: | | |
{"title":"ℹ️ ${{ steps.calc_size.outputs.uncompressed_size }}", "summary":"${{ steps.calc_size.outputs.uncompressed_size }}"} | |
- name: Compressed | |
uses: LouisBrunner/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: gzip | |
conclusion: ${{ job.status }} | |
output: | | |
{"title":"ℹ️ ${{ steps.calc_size.outputs.gzip_size }}", "summary":"${{ steps.calc_size.outputs.gzip_size }}"} |