ci: remove mac job and improve CI polling logic

This commit is contained in:
mkorwel
2026-04-16 15:28:00 +00:00
parent bc04e59075
commit ae3f3b6127
2 changed files with 19 additions and 25 deletions
+19 -11
View File
@@ -103,25 +103,33 @@ async function monitor() {
if (RUN_ID_OVERRIDE) {
targetRunIds = [RUN_ID_OVERRIDE];
} else {
// 1. Get runs directly associated with the branch
const headCommitTime = parseInt(
execSync(`git log -1 --format=%ct "${BRANCH}"`).toString().trim(),
10,
) * 1000;
// 1. Get recent runs associated with the branch, taking only the latest per unique workflow
const runListOutput = runGh(
`run list --branch "${BRANCH}" --limit 10 --json databaseId,status,workflowName,createdAt`,
`run list --branch "${BRANCH}" --limit 30 --json databaseId,status,workflowName,createdAt`,
);
if (runListOutput) {
const runs = JSON.parse(runListOutput);
const activeRuns = runs.filter((r) => r.status !== 'completed');
if (activeRuns.length > 0) {
targetRunIds = activeRuns.map((r) => r.databaseId);
} else if (runs.length > 0) {
const latestTime = new Date(runs[0].createdAt).getTime();
targetRunIds = runs
.filter((r) => latestTime - new Date(r.createdAt).getTime() < 60000)
.map((r) => r.databaseId);
const runs = JSON.parse(runListOutput).filter(
(r) => new Date(r.createdAt).getTime() >= headCommitTime - 30000,
).sort(
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
);
const seenWorkflows = new Set();
for (const r of runs) {
if (!seenWorkflows.has(r.workflowName)) {
seenWorkflows.add(r.workflowName);
targetRunIds.push(r.databaseId);
}
}
}
// 2. Get runs associated with commit statuses (handles chained/indirect runs)
try {
const headSha = execSync(`git rev-parse "${BRANCH}"`).toString().trim();
const statusOutput = runGh(
`api repos/${REPO}/commits/${headSha}/status -q '.statuses[] | select(.target_url | contains("actions/runs/")) | .target_url'`,
-14
View File
@@ -47,21 +47,7 @@ jobs:
run: 'npx vitest run packages/cli'
shell: 'bash'
test_mac:
name: 'Test (Mac) - CLI Unit'
runs-on: 'macos-large-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
- name: 'Setup and Build'
uses: './.github/actions/setup-gemini'
with:
mode: 'source'
- name: 'Run CLI Unit Tests'
run: 'npx vitest run packages/cli'
shell: 'bash'
test_windows:
name: 'Test (Windows) - CLI Unit'