Compare commits

...

8 Commits

Author SHA1 Message Date
Christian Gunderman afa763d985 test: trigger e2e workflow with prompt change 2026-03-02 16:15:28 -08:00
Christian Gunderman 37726d92b2 PR feedback. 2026-03-02 16:13:24 -08:00
Christian Gunderman 3be302afe3 Update scripts/changed_prompt.js
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-03-02 15:46:34 -08:00
Christian Gunderman 95a49be043 ci(evals): rename script and fix yamllint errors 2026-03-02 15:36:54 -08:00
Christian Gunderman 31cd47f230 ci(evals): use origin remote for trigger check 2026-03-02 15:25:04 -08:00
Christian Gunderman 4e1895986f ci(evals): add error logging to trigger script 2026-03-02 15:23:50 -08:00
Christian Gunderman 4462dbb861 refactor(ci): clean up check_evals_trigger.js 2026-03-02 15:22:53 -08:00
Christian Gunderman 90d0ea00c5 ci(evals): only run evals if prompts or tools changed 2026-03-02 15:19:54 -08:00
3 changed files with 63 additions and 2 deletions
+13 -2
View File
@@ -290,6 +290,7 @@ jobs:
with:
ref: '${{ needs.parse_run_context.outputs.sha }}'
repository: '${{ needs.parse_run_context.outputs.repository }}'
fetch-depth: 0
- name: 'Set up Node.js 20.x'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4
@@ -302,7 +303,14 @@ jobs:
- name: 'Build project'
run: 'npm run build'
- name: 'Run Evals (ALWAYS_PASSING)'
- name: 'Check if evals should run'
id: 'check_evals'
run: |
SHOULD_RUN=$(node scripts/changed_prompt.js)
echo "should_run=$SHOULD_RUN" >> "$GITHUB_OUTPUT"
- name: 'Run Evals (Required to pass)'
if: "${{ steps.check_evals.outputs.should_run == 'true' }}"
env:
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
run: 'npm run test:always_passing_evals'
@@ -315,6 +323,7 @@ jobs:
- 'e2e_linux'
- 'e2e_mac'
- 'e2e_windows'
- 'evals'
- 'merge_queue_skipper'
runs-on: 'gemini-cli-ubuntu-16-core'
steps:
@@ -322,7 +331,8 @@ jobs:
run: |
if [[ ${NEEDS_E2E_LINUX_RESULT} != 'success' || \
${NEEDS_E2E_MAC_RESULT} != 'success' || \
${NEEDS_E2E_WINDOWS_RESULT} != 'success' ]]; then
${NEEDS_E2E_WINDOWS_RESULT} != 'success' || \
${NEEDS_EVALS_RESULT} != 'success' ]]; then
echo "One or more E2E jobs failed."
exit 1
fi
@@ -331,6 +341,7 @@ jobs:
NEEDS_E2E_LINUX_RESULT: '${{ needs.e2e_linux.result }}'
NEEDS_E2E_MAC_RESULT: '${{ needs.e2e_mac.result }}'
NEEDS_E2E_WINDOWS_RESULT: '${{ needs.e2e_windows.result }}'
NEEDS_EVALS_RESULT: '${{ needs.evals.result }}'
set_workflow_status:
runs-on: 'gemini-cli-ubuntu-16-core'
+1
View File
@@ -772,3 +772,4 @@ The structure MUST be as follows:
</task_state>
</state_snapshot>`.trim();
}
// Trivial comment to test workflow
+49
View File
@@ -0,0 +1,49 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { execSync } from 'node:child_process';
const EVALS_FILE_PREFIXES = [
'packages/core/src/prompts/',
'packages/core/src/tools/',
'evals/',
];
function main() {
const targetBranch = process.env.GITHUB_BASE_REF || 'main';
try {
// Fetch target branch from origin.
execSync(`git fetch origin ${targetBranch}`, {
stdio: 'ignore',
});
// Find the merge base with the target branch.
const mergeBase = execSync('git merge-base HEAD FETCH_HEAD', {
encoding: 'utf-8',
}).trim();
// Get changed files
const changedFiles = execSync(`git diff --name-only ${mergeBase} HEAD`, {
encoding: 'utf-8',
})
.split('\n')
.filter(Boolean);
const shouldRun = changedFiles.some((file) =>
EVALS_FILE_PREFIXES.some((prefix) => file.startsWith(prefix)),
);
console.log(shouldRun ? 'true' : 'false');
} catch (error) {
// If anything fails (e.g., no git history), run evals to be safe
console.warn(
'Warning: Failed to determine if evals should run. Defaulting to true.',
);
console.error(error);
console.log('true');
}
}
main();