mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-14 05:17:18 -07:00
ec7f503d13
Adds the 'packages: read' permission to the 'bundle-size.yml' workflow. This is necessary to allow the job to download the package from the GitHub Packages registry to perform the size check.
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
# .github/workflows/bundle-size.yml
|
|
name: 'Bundle Size Check'
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
description: 'The version of the published package'
|
|
required: true
|
|
type: 'string'
|
|
|
|
permissions:
|
|
contents: 'read'
|
|
pull-requests: 'write'
|
|
packages: 'read'
|
|
|
|
jobs:
|
|
bundle-size:
|
|
name: 'Check Bundle Size'
|
|
runs-on: 'ubuntu-latest'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
|
|
with:
|
|
ref: '${{ github.event.inputs.branch_ref || github.ref }}'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Configure npm for GitHub Packages'
|
|
run: |
|
|
echo "@google-gemini:registry=https://npm.pkg.github.com/" > .npmrc
|
|
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm install @google-gemini/gemini-cli@${{ inputs.version }}'
|
|
|
|
- name: 'Check Bundle Size'
|
|
uses: 'preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a'
|
|
with:
|
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
pattern: './bundle/**/*.{js,sb}'
|
|
minimum-change-threshold: '1000'
|
|
compression: 'none'
|
|
clean-script: 'clean'
|