diff --git a/.github/actions/setup-gemini/action.yml b/.github/actions/setup-gemini/action.yml index 4d43c58aed..25d9f48912 100644 --- a/.github/actions/setup-gemini/action.yml +++ b/.github/actions/setup-gemini/action.yml @@ -16,6 +16,10 @@ inputs: dist-artifact: description: 'The name of the dist artifact to download if mode is "dist"' required: false + skip-npm-ci: + description: 'Whether to skip npm ci step' + required: false + default: 'false' runs: using: 'composite' @@ -27,6 +31,7 @@ runs: cache: 'npm' - name: 'Install dependencies' + if: "${{ inputs.skip-npm-ci != 'true' }}" run: 'npm ci' shell: 'bash' diff --git a/.github/workflows/ci-bundling-trial.yml b/.github/workflows/ci-bundling-trial.yml index 231a697b44..8296467680 100644 --- a/.github/workflows/ci-bundling-trial.yml +++ b/.github/workflows/ci-bundling-trial.yml @@ -10,17 +10,47 @@ concurrency: cancel-in-progress: true jobs: - test_ui_messages: - name: 'Test (Linux) - UI Messages' + build: + name: 'Build and Bundle' runs-on: 'gemini-cli-ubuntu-16-core' steps: - name: 'Checkout' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' - - name: 'Setup and Build' + - 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: 'Upload Workspace' + uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' + with: + name: 'workspace-artifact' + path: '.' + + test_ui_messages: + name: 'Test (Linux) - UI Messages' + needs: build + runs-on: 'gemini-cli-ubuntu-16-core' + steps: + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' + + - 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' @@ -28,15 +58,20 @@ jobs: test_ui_shared: name: 'Test (Linux) - UI Shared' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -44,15 +79,20 @@ jobs: test_ui_views: name: 'Test (Linux) - UI Views' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -60,15 +100,20 @@ jobs: test_ui_rest: name: 'Test (Linux) - UI Rest' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -76,15 +121,20 @@ jobs: test_ui_components_top: name: 'Test (Linux) - UI Components Top' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -92,15 +142,20 @@ jobs: test_batch_1: name: 'Test (Linux) - Batch 1 (Utils & Test-Utils)' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -108,15 +163,20 @@ jobs: test_batch_2: name: 'Test (Linux) - Batch 2 (Core & Services & ACP)' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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' @@ -124,15 +184,20 @@ jobs: test_batch_3: name: 'Test (Linux) - Batch 3 (Commands & Config)' + needs: build runs-on: 'gemini-cli-ubuntu-16-core' steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' + - name: 'Download Workspace' + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' + with: + name: 'workspace-artifact' + path: '.' - - name: 'Setup and 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'