From 8ad9efdbb0037f8032bd411d6ab662348a472aa6 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Tue, 14 Apr 2026 19:55:42 -0700 Subject: [PATCH] feat(ci): implement 'build once, test many' shared artifact architecture --- .github/actions/setup-gemini/action.yml | 18 ++++++++++++++++-- .github/workflows/ci-bundling-trial.yml | 21 +++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-gemini/action.yml b/.github/actions/setup-gemini/action.yml index 519974d166..cbaaae0065 100644 --- a/.github/actions/setup-gemini/action.yml +++ b/.github/actions/setup-gemini/action.yml @@ -9,6 +9,9 @@ inputs: bundle-artifact: description: 'The name of the bundle artifact to download if mode is "bundle"' required: false + dist-artifact: + description: 'The name of the dist artifact to download if mode is "dist"' + required: false runs: using: 'composite' @@ -35,11 +38,22 @@ runs: name: '${{ inputs.bundle-artifact }}' path: 'bundle' + - name: 'Download Dist Artifact' + if: "${{ inputs.mode == 'dist' }}" + uses: 'actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806' # v4 + with: + name: '${{ inputs.dist-artifact }}' + - name: 'Post-bundle setup' if: "${{ inputs.mode == 'bundle' }}" run: | # Ensure the bundle is ready for use - # In a real install, we might symlink bin/gemini to bundle/gemini.js - # For now, we just list it to verify it exists ls -R bundle shell: 'bash' + + - name: 'Post-dist setup' + if: "${{ inputs.mode == 'dist' }}" + run: | + # Verify dist files were restored + ls -d packages/*/dist + shell: 'bash' diff --git a/.github/workflows/ci-bundling-trial.yml b/.github/workflows/ci-bundling-trial.yml index f0ca4f097c..7c059b525d 100644 --- a/.github/workflows/ci-bundling-trial.yml +++ b/.github/workflows/ci-bundling-trial.yml @@ -6,8 +6,8 @@ on: - 'feat/ci-bundling-revamp' jobs: - build_bundle: - name: 'Build Bundle' + build: + name: 'Build All Artifacts' runs-on: 'gemini-cli-ubuntu-16-core' steps: - name: 'Checkout' @@ -22,6 +22,7 @@ jobs: - name: 'Install & Build' run: | npm ci + npm run build npm run bundle - name: 'Upload Bundle' @@ -30,17 +31,25 @@ jobs: name: 'gemini-bundle' path: 'bundle/' + - name: 'Upload Compiled Dist' + uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02' # v4 + with: + name: 'gemini-dist' + path: 'packages/*/dist/' + test_cli_unit: - name: 'Test (Linux) - CLI Unit Tests' + name: 'Test (Linux) - CLI Unit (Shared Dist)' + needs: 'build' runs-on: 'gemini-cli-ubuntu-16-core' steps: - name: 'Checkout' uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' - - name: 'Setup Source' + - name: 'Setup with Dist' uses: './.github/actions/setup-gemini' with: - mode: 'source' + mode: 'dist' + dist-artifact: 'gemini-dist' - name: 'Run CLI Unit Tests' run: 'npx vitest run packages/cli' @@ -48,7 +57,7 @@ jobs: test_with_bundle: name: 'Test (Linux) - Bundled Integration' - needs: 'build_bundle' + needs: 'build' runs-on: 'gemini-cli-ubuntu-16-core' steps: - name: 'Checkout'