mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 20:06:10 +00:00
* ci: full checks on main pushes, changed-file lint on PRs, Slack alert when main breaks PR Checks now also runs on every push to main, with each commit in its own concurrency group so main runs never cancel one another. On a push the path router gets an empty diff, which already fails closed to every job, and the input-scoped steps (localization extraction, VM rollback replay, orcad smoke) run in full. Advisory E2E lanes stay PR-only. On PRs the per-file passes (root oxlint, JS-plugin oxlint, anti-slop, ast-grep and oxfmt) check only the changed paths. Everything is checked when the diff cannot be resolved, a lint toolchain input changes (oxlint/oxfmt/ast-grep configs and plugins, package.json, the lockfile, .gitignore, pr.yml), or more than 1500 paths change. Whole-program checks stay unscoped. A new workflow follows completed main runs and posts to the release Slack webhook only when main turns red, and once when it turns green again. * ci: alert once per main health streak and tolerate a malformed Slack mapping
40 lines
1.9 KiB
JavaScript
40 lines
1.9 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { parse } from 'yaml'
|
|
import { compileAggregateExpression } from './pr-aggregate-gate-context.mjs'
|
|
|
|
const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8'))
|
|
const evaluate = (expression, github) =>
|
|
compileAggregateExpression(expression, ['github'])({ github }).coerceString()
|
|
|
|
describe('main push runs of PR Checks', () => {
|
|
it('run every main commit to completion without cancelling one another', () => {
|
|
expect(workflow.on.push).toEqual({ branches: ['main'] })
|
|
const push = { event_name: 'push', sha: 'abc', event: {} }
|
|
const pr = { event_name: 'pull_request', sha: 'def', event: { pull_request: { number: 7 } } }
|
|
expect(evaluate(workflow.concurrency.group, push)).toBe('main-checks-abc')
|
|
expect(evaluate(workflow.concurrency['cancel-in-progress'], push)).toBe('false')
|
|
expect(evaluate(workflow.concurrency.group, pr)).toBe('pr-checks-7')
|
|
expect(evaluate(workflow.concurrency['cancel-in-progress'], pr)).toBe('true')
|
|
})
|
|
|
|
it('select every job, and run every input-scoped step in full', () => {
|
|
const classify = workflow.jobs.code_paths.steps.find((step) => step.id === 'filter')
|
|
expect(classify.run).toContain(`if [ "$GITHUB_EVENT_NAME" = push ]; then CHANGED=''`)
|
|
for (const name of [
|
|
'Verify localization extraction',
|
|
'Check VM runtime rollback compatibility',
|
|
'Decide whether the orcad terminal smoke runs',
|
|
'Select per-file lint scope'
|
|
]) {
|
|
const step = workflow.jobs.preflight.steps.find((candidate) => candidate.name === name)
|
|
expect(step.run, name).toContain('[ "$GITHUB_EVENT_NAME" = pull_request ]')
|
|
}
|
|
})
|
|
|
|
it('report a result for main pushes through the aggregate', () => {
|
|
const verify = compileAggregateExpression(workflow.jobs.verify.if, ['github'])
|
|
expect(verify({ github: { event_name: 'push', event: {} } }).coerceString()).toBe('true')
|
|
})
|
|
})
|