From d15f70867afaef840098454a0c6984c0eaea027d Mon Sep 17 00:00:00 2001 From: "gemini-cli[bot]" Date: Tue, 5 May 2026 17:50:02 +0000 Subject: [PATCH] # CI Optimization: Path-Based Triggers to Reduce Action Spend ## Problem Repository metrics showed a massive surge in GitHub Action minutes (+5198 min in a short period). Investigation revealed that heavy CI (`ci.yml`) and E2E (`trigger_e2e.yml`) workflows were running on every PR, including those only affecting documentation or other non-functional files. This leads to unnecessary resource consumption and longer wait times for contributors. ## Changes - **Implemented Path Filters**: Added `paths-ignore` to `ci.yml` and `trigger_e2e.yml` for non-functional files (docs, markdown, templates, etc.). - **Sharded Content Checks**: Created a new, lightweight `.github/workflows/content-check.yml` that specifically runs the `link_checker` job on documentation changes. - **Improved Workflow Robustness**: Fixed quoting in the `ci.yml` strategy matrix to satisfy both `yamllint` and `actionlint`. - **Refined Rollup Logic**: Updated the `ci` rollup job in `ci.yml` to remove the dependency on the now-sharded `link_checker`. ## Impact - Significant reduction in `actions_spend_minutes` for documentation-only PRs. - Reduced resource pressure on the 16-core runners. - Faster feedback for contributors making minor updates. - Directly addresses the "Action Spend Anomaly" identified in the Brain phase metrics analysis. --- .github/workflows/ci.yml | 41 +++++++++++++++++------------ .github/workflows/content-check.yml | 21 +++++++++++++++ .github/workflows/trigger_e2e.yml | 11 ++++++++ 3 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/content-check.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c022e2916c..9964ede6dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,32 @@ on: branches: - 'main' - 'release/**' + paths-ignore: + - 'docs/**' + - '**/*.md' + - '.github/ISSUE_TEMPLATE/**' + - '.github/pull_request_template.md' + - '.gitignore' + - '.editorconfig' + - 'LICENSE' + - 'CONTRIBUTING.md' + - 'ROADMAP.md' + - 'SECURITY.md' pull_request: branches: - 'main' - 'release/**' + paths-ignore: + - 'docs/**' + - '**/*.md' + - '.github/ISSUE_TEMPLATE/**' + - '.github/pull_request_template.md' + - '.gitignore' + - '.editorconfig' + - 'LICENSE' + - 'CONTRIBUTING.md' + - 'ROADMAP.md' + - 'SECURITY.md' merge_group: workflow_dispatch: inputs: @@ -123,18 +145,6 @@ jobs: - name: 'Run GitHub Actions pinning linter' run: 'node scripts/lint.js --check-github-actions-pinning' - link_checker: - name: 'Link Checker' - runs-on: 'ubuntu-latest' - if: "github.repository == 'google-gemini/gemini-cli'" - steps: - - name: 'Checkout' - uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5 - - name: 'Link Checker' - uses: 'lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2' # ratchet: lycheeverse/lychee-action@v2.6.1 - with: - args: '--verbose --accept 200,503 ./**/*.md' - fail: true test_linux: name: 'Test (Linux) - ${{ matrix.node-version }}, ${{ matrix.shard }}' runs-on: 'gemini-cli-ubuntu-16-core' @@ -147,7 +157,7 @@ jobs: pull-requests: 'write' strategy: matrix: - node-version: ${{ fromJSON(github.event_name == 'pull_request' && '["20.x"]' || '["20.x", "22.x", "24.x"]') }} + node-version: '${{ fromJSON(github.event_name == ''pull_request'' && ''["20.x"]'' || ''["20.x", "22.x", "24.x"]'') }}' shard: - 'cli' - 'others' @@ -239,7 +249,7 @@ jobs: continue-on-error: true strategy: matrix: - node-version: ${{ fromJSON(github.event_name == 'pull_request' && '["20.x"]' || '["20.x", "22.x", "24.x"]') }} + node-version: '${{ fromJSON(github.event_name == ''pull_request'' && ''["20.x"]'' || ''["20.x", "22.x", "24.x"]'') }}' shard: - 'cli' - 'others' @@ -471,7 +481,6 @@ jobs: if: "github.repository == 'google-gemini/gemini-cli' && always()" needs: - 'lint' - - 'link_checker' - 'test_linux' - 'test_mac' - 'test_windows' @@ -482,7 +491,6 @@ jobs: - name: 'Check all job results' run: | if [[ (${NEEDS_LINT_RESULT} != 'success' && ${NEEDS_LINT_RESULT} != 'skipped') || \ - (${NEEDS_LINK_CHECKER_RESULT} != 'success' && ${NEEDS_LINK_CHECKER_RESULT} != 'skipped') || \ (${NEEDS_TEST_LINUX_RESULT} != 'success' && ${NEEDS_TEST_LINUX_RESULT} != 'skipped') || \ (${NEEDS_TEST_MAC_RESULT} != 'success' && ${NEEDS_TEST_MAC_RESULT} != 'skipped') || \ (${NEEDS_TEST_WINDOWS_RESULT} != 'success' && ${NEEDS_TEST_WINDOWS_RESULT} != 'skipped') || \ @@ -494,7 +502,6 @@ jobs: echo "All CI jobs passed!" env: NEEDS_LINT_RESULT: '${{ needs.lint.result }}' - NEEDS_LINK_CHECKER_RESULT: '${{ needs.link_checker.result }}' NEEDS_TEST_LINUX_RESULT: '${{ needs.test_linux.result }}' NEEDS_TEST_MAC_RESULT: '${{ needs.test_mac.result }}' NEEDS_TEST_WINDOWS_RESULT: '${{ needs.test_windows.result }}' diff --git a/.github/workflows/content-check.yml b/.github/workflows/content-check.yml new file mode 100644 index 0000000000..7e55f7aafd --- /dev/null +++ b/.github/workflows/content-check.yml @@ -0,0 +1,21 @@ +name: '🔍 Content Check' + +on: + pull_request: + paths: + - '**/*.md' + - '.github/workflows/content-check.yml' + +jobs: + link_checker: + name: 'Link Checker' + runs-on: 'ubuntu-latest' + if: "github.repository == 'google-gemini/gemini-cli'" + steps: + - name: 'Checkout' + uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4 + - name: 'Link Checker' + uses: 'lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2' # ratchet:lycheeverse/lychee-action@v2.6.1 + with: + args: '--verbose --accept 200,503 ./**/*.md' + fail: true diff --git a/.github/workflows/trigger_e2e.yml b/.github/workflows/trigger_e2e.yml index 56da2727c5..c7c3999124 100644 --- a/.github/workflows/trigger_e2e.yml +++ b/.github/workflows/trigger_e2e.yml @@ -12,6 +12,17 @@ on: required: false type: 'string' pull_request: + paths-ignore: + - 'docs/**' + - '**/*.md' + - '.github/ISSUE_TEMPLATE/**' + - '.github/pull_request_template.md' + - '.gitignore' + - '.editorconfig' + - 'LICENSE' + - 'CONTRIBUTING.md' + - 'ROADMAP.md' + - 'SECURITY.md' jobs: save_repo_name: