From 7787a31f81ce17fe1a0e96c0c625b8f63e2068b7 Mon Sep 17 00:00:00 2001 From: shishu314 Date: Thu, 23 Oct 2025 13:14:40 -0400 Subject: [PATCH] feat(infra) - Make merge group and pushes run chained e2e (#11796) Co-authored-by: gemini-cli-robot --- .github/workflows/test_chained_e2e.yml | 58 +++++++++++++++++++------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test_chained_e2e.yml b/.github/workflows/test_chained_e2e.yml index 6e0328475d..ba156e316f 100644 --- a/.github/workflows/test_chained_e2e.yml +++ b/.github/workflows/test_chained_e2e.yml @@ -1,6 +1,10 @@ name: 'Test Chained E2E' on: + push: + branches: + - 'main' + merge_group: workflow_run: workflows: ['Trigger E2E'] types: ['completed'] @@ -36,11 +40,12 @@ jobs: download_repo_name: runs-on: 'gemini-cli-ubuntu-16-core' + if: "github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'" outputs: repo_name: '${{ steps.output-repo-name.outputs.repo_name }}' steps: - name: 'Mock Repo Artifact' - if: "${{ github.event_name != 'workflow_run' }}" + if: "${{ github.event_name == 'workflow_dispatch' }}" env: REPO_NAME: '${{ github.event.inputs.repo_name }}' run: | @@ -71,24 +76,44 @@ jobs: const repo_name = String(fs.readFileSync(path.join(temp, 'repo_name'))); core.setOutput('repo_name', repo_name); + parse_run_context: + name: 'Parse run context' + runs-on: 'gemini-cli-ubuntu-16-core' + needs: 'download_repo_name' + if: 'always()' + outputs: + repository: '${{ steps.set_context.outputs.REPO }}' + sha: '${{ steps.set_context.outputs.SHA }}' + steps: + - id: 'set_context' + name: 'Set dynamic repository and SHA' + env: + REPO: '${{ needs.download_repo_name.outputs.repo_name || github.repository }}' + SHA: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha || github.sha }}' + shell: 'bash' + run: | + echo "REPO=$REPO" >> "$GITHUB_OUTPUT" + echo "SHA=$SHA" >> "$GITHUB_OUTPUT" + set_pending_status: runs-on: 'gemini-cli-ubuntu-16-core' + if: "github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'" needs: - - 'download_repo_name' + - 'parse_run_context' steps: - name: 'Set pending status' uses: 'myrotvorets/set-commit-status-action@16037e056d73b2d3c88e37e393ff369047f70886' # ratchet:myrotvorets/set-commit-status-action@master if: 'always()' with: allowForks: 'true' - repo: '${{ needs.download_repo_name.outputs.repo_name }}' - sha: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha }}' + repo: '${{ needs.parse_run_context.outputs.repository }}' + sha: '${{ needs.parse_run_context.outputs.sha }}' token: '${{ secrets.GITHUB_TOKEN }}' status: 'pending' e2e_linux: name: 'E2E Test (Linux) - ${{ matrix.sandbox }}' - needs: 'download_repo_name' + needs: 'parse_run_context' runs-on: 'gemini-cli-ubuntu-16-core' strategy: fail-fast: false @@ -103,8 +128,8 @@ jobs: - name: 'Checkout' uses: 'actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955' # ratchet:actions/checkout@v5 with: - ref: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha }}' - repository: '${{ needs.download_repo_name.outputs.repo_name }}' + ref: '${{ needs.parse_run_context.outputs.sha }}' + repository: '${{ needs.parse_run_context.outputs.repository }}' - name: 'Set up Node.js ${{ matrix.node-version }}' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4 @@ -136,14 +161,14 @@ jobs: e2e_mac: name: 'E2E Test (macOS)' - needs: 'download_repo_name' + needs: 'parse_run_context' runs-on: 'macos-latest' steps: - name: 'Checkout' uses: 'actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955' # ratchet:actions/checkout@v5 with: - ref: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha }}' - repository: '${{ needs.download_repo_name.outputs.repo_name }}' + ref: '${{ needs.parse_run_context.outputs.sha }}' + repository: '${{ needs.parse_run_context.outputs.repository }}' - name: 'Set up Node.js 20.x' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4 @@ -173,7 +198,7 @@ jobs: name: 'Slow E2E - Win' needs: - 'merge_queue_skipper' - - 'download_repo_name' + - 'parse_run_context' if: | needs.merge_queue_skipper.outputs.skip == 'false' runs-on: 'gemini-cli-windows-16-core' @@ -183,8 +208,8 @@ jobs: - name: 'Checkout' uses: 'actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955' # ratchet:actions/checkout@v5 with: - ref: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha }}' - repository: '${{ needs.download_repo_name.outputs.repo_name }}' + ref: '${{ needs.parse_run_context.outputs.sha }}' + repository: '${{ needs.parse_run_context.outputs.repository }}' - name: 'Set up Node.js 20.x' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4 @@ -251,8 +276,9 @@ jobs: set_workflow_status: runs-on: 'gemini-cli-ubuntu-16-core' + if: "github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'" needs: - - 'download_repo_name' + - 'parse_run_context' - 'e2e' steps: - name: 'Set workflow status' @@ -260,7 +286,7 @@ jobs: if: 'always()' with: allowForks: 'true' - repo: '${{ needs.download_repo_name.outputs.repo_name }}' - sha: '${{ github.event.inputs.head_sha || github.event.workflow_run.head_sha }}' + repo: '${{ needs.parse_run_context.outputs.repository }}' + sha: '${{ needs.parse_run_context.outputs.sha }}' token: '${{ secrets.GITHUB_TOKEN }}' status: '${{ job.status }}'