name: CI on: pull_request: branches: [main] paths: - "packages/**" - "bin/**" - "tsconfig.base.json" - "tsconfig.tooling.json" - "plugins/**" - "design/**" - ".agents/plugins/**" - ".claude-plugin/**" - "package.json" - "pnpm-lock.yaml" - "pnpm-workspace.yaml" - ".github/workflows/**" - ".npmrc" - ".oxlintrc.json" - ".prettier*" # bin/lint.sh checks every relative link in the repository's Markdown, not only # the files under packages/. - "**/*.md" push: branches: [main] paths: - "packages/**" - "bin/**" - "tsconfig.base.json" - "tsconfig.tooling.json" - "plugins/**" - "design/**" - ".agents/plugins/**" - ".claude-plugin/**" - "package.json" - "pnpm-lock.yaml" - "pnpm-workspace.yaml" - ".github/workflows/**" - ".npmrc" - ".oxlintrc.json" - ".prettier*" # bin/lint.sh checks every relative link in the repository's Markdown, not only # the files under packages/. - "**/*.md" permissions: contents: read # Pushing a fixup three times in a row used to start three complete pipelines — # build-test alone is four os/node combinations — and all three ran to completion. # Only the newest commit's result can still be acted on, so the older runs are # cancelled the moment a new one starts for the same ref. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint: if: github.repository == 'chaxus/ran' runs-on: ubuntu-latest name: "Lint & Type-check" # Every other job in this repository is bounded; this one was not, so a step that # hung would hold a runner for the default 360 minutes. The job normally finishes # in a few minutes, so 20 is generous rather than tight. timeout-minutes: 20 steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version-file: .nvmrc cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Verify repository scripts run: pnpm run verify:scripts - name: Verify coordinated release metadata run: pnpm release:check # Generated docs (ranui COMPONENTS.md / style tokens, ranuts API.md and its two # docs-site copies) are committed. Without this, a component API change that # skipped `doc:api` leaves the reference silently wrong. # # `verify:docs` also runs `docs check:langs`. That gate already existed but was # wired only into the release workflow, so a PR could drop a page from one # language and stay green until someone cut a release. - name: Generated docs are fresh and every locale is complete run: pnpm run verify:docs # The executable half of docs/DESIGN.md. Prose rules only hold while whoever # edits a component has read the paragraph; this ratchets the known violations # so no new one lands and no fix silently regresses. - name: Design rules hold run: pnpm run verify:design # bin/lint.sh is the whole gate: oxlint, Prettier, the tooling type-check, every # Markdown link, the package manifest and each package's tsc. Those used to run here # as separate steps as well, so each executed twice per PR. - name: Lint run: pnpm run lint build-test: if: github.repository == 'chaxus/ran' timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] node_version: [24, 26] include: - os: macos-latest node_version: 26 - os: windows-latest node_version: 26 fail-fast: false name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}" steps: # Shallow: release:prepare reads only HEAD, the porcelain status and the branch # name, and release.yml already runs it on a shallow checkout. - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node_version }} cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build run: pnpm run build - name: Lint published package manifests if: matrix.os == 'ubuntu-latest' && matrix.node_version == 24 run: pnpm run publint - name: Verify packed library consumers and import budget if: matrix.os == 'ubuntu-latest' && matrix.node_version == 24 run: pnpm run verify:consumers - name: Verify real installation of release archives if: matrix.os == 'ubuntu-latest' && matrix.node_version == 24 run: | pnpm release:prepare pnpm verify:release # `pnpm run test` reaches ranui through `run-checks.ts`, which runs the package's # own `test` script. That script runs `vitest run`; the coverage gate used to be a # separate step that ran `vitest run --coverage` afterwards, executing the same # suite a second time to produce one report. Asking for coverage up front makes the # single pass both the test run and the threshold check. - name: Test run: pnpm run test env: RANUI_COVERAGE: ${{ matrix.os == 'ubuntu-latest' && matrix.node_version == 24 && '1' || '0' }}