Skip to content

ci: release packages #211

ci: release packages

ci: release packages #211

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- run: bun run build
- name: Smoke test CLI bundle
run: cd apps/kimi-code && bun run smoke
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- name: Install Rust toolchain (kimi-native-tools)
uses: dtolnay/rust-toolchain@stable
- name: Build kimi-native-tools
run: cd packages/kimi-native-tools && bun run build
- run: bun run test --shard=${{ matrix.shard }}/5
# pi-tui's suite runs on node:test (not vitest), so the root `bun run test`
# does not execute it; it needs its own job.
test-pi-tui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- run: cd packages/pi-tui && bun run test
# The VS Code extension suite runs on the default (v2) engine as part of the
# sharded root run above; this job reruns it on the legacy v1 engine, which
# the extension selects through the rollback env var.
test-vscode-legacy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- run: cd apps/vscode && bun run test
env:
KIMI_CODE_LEGACY_FLAG: "1"
test-windows:
runs-on: windows-latest
# Temporarily disabled while Windows tests are being stabilized.
if: false
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
# Windows runners are slower and run the whole suite (including
# in-process e2e tests) under more contention, so the default 5s test
# timeout causes flaky failures. Give it more headroom.
- run: bun run test -- --testTimeout=30000
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run sherif
# Locale consistency: en/zh key parity, placeholder validity, and JSON
# freshness (regenerate, then fail if tracked JSON drifted from the TS sources).
- run: node scripts/check-locale-keys.mjs
- run: node scripts/check-locale-placeholders.cjs
- run: node scripts/generate-locale-json.cjs && git diff --exit-code -- '**/locales/*.json'
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
- name: Typecheck
run: |
bunx --package @typescript/native-preview@beta tsgo --version
for config in packages/*/tsconfig.json apps/kimi-code/tsconfig.json; do
echo "Typechecking ${config}"
bunx --package @typescript/native-preview@beta tsgo -p "${config}" --noEmit
done
- name: Typecheck VS Code extension
run: cd apps/vscode && bun run typecheck
- name: Typecheck vis-server
run: cd apps/vis/server && bun run typecheck
- name: Typecheck vis-web
run: cd apps/vis/web && bun run typecheck