ci(lotus): hard-gate lint, format and unit tests before build; add concurrency
The workflow only built and smoke-checked that dist/index.html existed, so a type error, lint violation or failing test could be tagged straight to a published npm release. Run `pnpm lint` (tsc + oxlint + knip), `pnpm format:check` (oxfmt) and `pnpm test:unit --run` before the build, all hard. Add the same cancel-in-progress concurrency group cinny's CI uses so rapid pushes to lotus don't queue redundant full builds. Also fixes the one tsc error the v0.25.0 merge surfaced in lotusDecorations (lazyActions.off now returns the emitter), so the new gate is green from its first run. Fixes #5 Fixes #34 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
co-authored by
Claude Opus 5
parent
4e6b5e1b9b
commit
9c52146312
@@ -20,6 +20,12 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [lotus]
|
branches: [lotus]
|
||||||
|
|
||||||
|
# A superseded push cancels its in-flight run (same guard as cinny's ci.yml):
|
||||||
|
# rapid pushes to lotus otherwise queue one full build each on the shared runner.
|
||||||
|
concurrency:
|
||||||
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# element-call's build:full sets 16384 already; keep parity for safety.
|
# element-call's build:full sets 16384 already; keep parity for safety.
|
||||||
NODE_OPTIONS: "--max-old-space-size=16384"
|
NODE_OPTIONS: "--max-old-space-size=16384"
|
||||||
@@ -48,6 +54,18 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# ── Quality gates (hard) — run BEFORE the slow build so a type/lint/
|
||||||
|
# format/test error fails in seconds. Upstream replaced eslint+prettier
|
||||||
|
# with oxlint+oxfmt in v0.25.0; `pnpm lint` = tsc + oxlint + knip.
|
||||||
|
- name: Lint (tsc + oxlint + knip)
|
||||||
|
run: pnpm lint
|
||||||
|
|
||||||
|
- name: Format check (oxfmt)
|
||||||
|
run: pnpm format:check
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: pnpm test:unit --run
|
||||||
|
|
||||||
- name: Build embedded
|
- name: Build embedded
|
||||||
# build:embedded writes to the repo-root dist/ (vite default outDir).
|
# build:embedded writes to the repo-root dist/ (vite default outDir).
|
||||||
# Stage it into embedded/web/dist — the publish template's "files" entry
|
# Stage it into embedded/web/dist — the publish template's "files" entry
|
||||||
|
|||||||
@@ -84,8 +84,9 @@ export function startLotusDecorations(): () => void {
|
|||||||
emit();
|
emit();
|
||||||
};
|
};
|
||||||
w.lazyActions.on(LotusWidgetActions.Decorations, handler);
|
w.lazyActions.on(LotusWidgetActions.Decorations, handler);
|
||||||
unregister = (): void =>
|
unregister = (): void => {
|
||||||
w.lazyActions.off(LotusWidgetActions.Decorations, handler);
|
w.lazyActions.off(LotusWidgetActions.Decorations, handler);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
registrations += 1;
|
registrations += 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user