mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 12:00:18 -07:00
450 lines
13 KiB
YAML
450 lines
13 KiB
YAML
name: 'Bundling Trial CI'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'feat/ci-bundling-revamp'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish_packages:
|
|
name: 'Publish Packages to GitHub'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Bundle'
|
|
run: 'npm run bundle'
|
|
shell: 'bash'
|
|
|
|
- name: 'Set version with SHA'
|
|
run: |
|
|
npm version 0.0.0-${{ github.sha }} --no-git-tag-version --workspaces
|
|
shell: 'bash'
|
|
|
|
- name: 'Prepare Packages for Bundled Release'
|
|
run: 'node scripts/prepare-bundle-package.js'
|
|
shell: 'bash'
|
|
|
|
- name: 'Configure npm for GitHub Packages'
|
|
run: |
|
|
rm -f .npmrc
|
|
echo ""@google-gemini:registry=https://npm.pkg.github.com"" > ~/.npmrc
|
|
echo ""//npm.pkg.github.com/:_authToken=\${{ secrets.GITHUB_TOKEN }}"" >> ~/.npmrc
|
|
echo ""@google:registry=https://wombat-dressing-room.appspot.com"" >> ~/.npmrc
|
|
shell: 'bash'
|
|
|
|
- name: 'Publish Packages'
|
|
run: |
|
|
npm publish --workspace @google-gemini/gemini-cli-core --registry=https://npm.pkg.github.com
|
|
npm publish --workspace @google-gemini/gemini-cli --registry=https://npm.pkg.github.com
|
|
shell: 'bash'
|
|
|
|
test_ui_messages:
|
|
name: 'cli:ui/messages'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run UI Messages Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/ui/components/messages'
|
|
shell: 'bash'
|
|
|
|
test_ui_shared:
|
|
name: 'cli:ui/shared'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run UI Shared Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/ui/components/shared'
|
|
shell: 'bash'
|
|
|
|
test_ui_views:
|
|
name: 'cli:ui/views'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run UI Views Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/ui/components/views packages/cli/src/ui/components/SessionBrowser'
|
|
shell: 'bash'
|
|
|
|
test_ui_rest:
|
|
name: 'cli:ui/rest'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run UI Rest Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/ui/App.test.tsx packages/cli/src/ui/AppContainer.test.tsx packages/cli/src/ui/IdeIntegrationNudge.test.tsx packages/cli/src/ui/ToolConfirmationFullFrame.test.tsx packages/cli/src/ui/auth packages/cli/src/ui/commands packages/cli/src/ui/contexts packages/cli/src/ui/hooks packages/cli/src/ui/key packages/cli/src/ui/layouts packages/cli/src/ui/noninteractive packages/cli/src/ui/privacy packages/cli/src/ui/state packages/cli/src/ui/themes packages/cli/src/ui/utils'
|
|
shell: 'bash'
|
|
|
|
test_ui_components_top:
|
|
name: 'cli:ui/components'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run UI Components Top Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/ui/components/*.test.tsx'
|
|
shell: 'bash'
|
|
|
|
test_batch_1:
|
|
name: 'cli:utils'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run Batch 1 Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/test-utils packages/cli/src/utils'
|
|
shell: 'bash'
|
|
|
|
test_batch_2:
|
|
name: 'cli:core-services'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run Batch 2 Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/core packages/cli/src/services packages/cli/src/acp'
|
|
shell: 'bash'
|
|
|
|
test_batch_3:
|
|
name: 'cli:commands-config'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run Batch 3 Tests'
|
|
run: 'npx vitest run --pool=threads packages/cli/src/commands packages/cli/src/config'
|
|
shell: 'bash'
|
|
|
|
test_core:
|
|
name: 'core'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
env:
|
|
GEMINI_SANDBOX: 'false'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Setup Gemini'
|
|
uses: './.github/actions/setup-gemini'
|
|
with:
|
|
mode: 'source'
|
|
skip-npm-ci: 'true'
|
|
|
|
- name: 'Run All Core Tests'
|
|
run: 'npx vitest run --pool=threads packages/core/src --exclude "**/*.integration.test.ts"'
|
|
shell: 'bash'
|
|
|
|
test_e2e:
|
|
name: 'e2e:linux'
|
|
runs-on: 'gemini-cli-ubuntu-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Build Bundle'
|
|
run: 'npm run bundle'
|
|
|
|
- name: 'Run Integration Tests'
|
|
env:
|
|
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
|
|
KEEP_OUTPUT: 'true'
|
|
VERBOSE: 'true'
|
|
run: 'npm run test:integration:sandbox:none'
|
|
shell: 'bash'
|
|
|
|
test_e2e_mac:
|
|
name: 'e2e:mac'
|
|
runs-on: 'macos-latest-large'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
|
|
- name: 'Build Bundle'
|
|
run: 'npm run bundle'
|
|
|
|
- name: 'Fix rollup optional dependencies on macOS'
|
|
run: 'npm cache clean --force'
|
|
shell: 'bash'
|
|
|
|
- name: 'Run Integration Tests'
|
|
env:
|
|
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
|
|
KEEP_OUTPUT: 'true'
|
|
VERBOSE: 'true'
|
|
run: 'npm run test:integration:sandbox:none'
|
|
shell: 'bash'
|
|
|
|
test_e2e_windows_full:
|
|
name: 'e2e:windows:full'
|
|
runs-on: 'gemini-cli-windows-16-core'
|
|
timeout-minutes: 60
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm ci'
|
|
shell: 'pwsh'
|
|
|
|
- name: 'Build project'
|
|
run: 'npm run build'
|
|
shell: 'pwsh'
|
|
|
|
- name: 'Run Integration Tests'
|
|
env:
|
|
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
|
|
KEEP_OUTPUT: 'true'
|
|
VERBOSE: 'true'
|
|
run: 'npm run test:integration:sandbox:none'
|
|
shell: 'pwsh'
|
|
|
|
test_e2e_windows_fast:
|
|
name: 'e2e:windows:fast'
|
|
needs: publish_packages
|
|
runs-on: 'gemini-cli-windows-16-core'
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
|
|
|
- name: 'Set up Node.js'
|
|
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
|
|
- name: 'Configure npm for GitHub Packages'
|
|
run: |
|
|
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > "$env:USERPROFILE\.npmrc"
|
|
echo "@google-gemini:registry=https://npm.pkg.github.com" >> "$env:USERPROFILE\.npmrc"
|
|
shell: 'pwsh'
|
|
|
|
- name: 'Install dependencies'
|
|
run: 'npm install @google-gemini/gemini-cli@0.0.0-${{ github.sha }} vitest node-pty --no-save'
|
|
shell: 'pwsh'
|
|
|
|
- name: 'Run Integration Tests'
|
|
env:
|
|
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
|
|
KEEP_OUTPUT: 'true'
|
|
VERBOSE: 'true'
|
|
run: 'npm run test:integration:sandbox:none'
|
|
shell: 'pwsh'
|