Skip to content

feat: support KIMI_CODE_HOME environment variable for relocatable dat… #54

feat: support KIMI_CODE_HOME environment variable for relocatable dat…

feat: support KIMI_CODE_HOME environment variable for relocatable dat… #54

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
working-directory: ./validator
run: |
python3 -m pip install --upgrade pip
python3 -m pip install jsonschema pyyaml pytest ruff
- name: Run tests
working-directory: ./validator
run: python3 -m pytest -v
- name: Run linter
working-directory: ./validator
run: ruff check . || true
- name: Install files
run: make install
- name: Validate install
run: make verify
- name: Check sync
run: make sync
- name: Run compliance check
working-directory: ./validator
run: python3 validate_kimi.py compliance ~/.kimi-code
test-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
working-directory: ./validator
run: |
python3 -m pip install --upgrade pip
python3 -m pip install jsonschema pyyaml pytest ruff
- name: Run tests
working-directory: ./validator
run: python3 -m pytest -v
- name: Install files
run: make install
- name: Validate install
run: make verify
- name: Check sync
run: make sync
- name: Run validator checks
run: make check
test-windows-pwsh:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
shell: pwsh
working-directory: ./validator
run: |
python -m pip install --upgrade pip
python -m pip install jsonschema pyyaml pytest ruff
- name: Run tests
shell: pwsh
working-directory: ./validator
run: python -m pytest -v
- name: Install files via Makefile
shell: pwsh
run: make install-windows
- name: Validate PowerShell scripts syntax
shell: pwsh
run: |
Get-ChildItem "$env:USERPROFILE\.kimi-code\*.ps1" | ForEach-Object {
$null = [System.Management.Automation.PSParser]::Tokenize((Get-Content $_.FullName -Raw), [ref]$null)
Write-Host "Syntax OK: $($_.Name)"
}
- name: Verify files present
shell: pwsh
run: |
$files = @("config.toml", "kimi.toml", "mandate-agent.yaml", "mandate-kimiko-agent.yaml", "activate-mandate.ps1", "kimi-wrapper.ps1", "kimi-shell-integration.ps1", "launch-with-mandate.ps1", "kimi.json")
foreach ($f in $files) {
$path = Join-Path $env:USERPROFILE ".kimi-code" $f
if (Test-Path $path) { Write-Host "OK: $f" }
else { Write-Host "MISSING: $f"; exit 1 }
}
- name: Verify JSON valid
shell: pwsh
run: |
$json = Get-Content "$env:USERPROFILE\.kimi-code\kimi.json" -Raw
$null = $json | ConvertFrom-Json
Write-Host "kimi.json: valid JSON"
- name: Verify kimiko references
shell: pwsh
run: |
$config = Get-Content "$env:USERPROFILE\.kimi-code\config.toml" -Raw
if ($config -notmatch '(?m)^\s*mandate_code\s*=\s*[''"]kimiko[''"]') { Write-Host "config.toml missing mandate_code 'kimiko'"; exit 1 }
$mandate = Get-Content "$env:USERPROFILE\.kimi-code\mandate-kimiko-agent.yaml" -Raw
if ($mandate -notmatch '(?m)^\s*mandate_code:\s*[''"]kimiko[''"]') { Write-Host "mandate-kimiko-agent.yaml missing mandate_code 'kimiko'"; exit 1 }
Write-Host "kimiko references verified"
- name: Check sync (PowerShell)
shell: pwsh
run: make sync
- name: Run compliance check
shell: pwsh
working-directory: ./validator
run: python validate_kimi.py compliance "$env:USERPROFILE\.kimi-code"
test-windows-gitbash:
runs-on: windows-latest
env:
MSYSTEM: MINGW64
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
working-directory: ./validator
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install jsonschema pyyaml pytest ruff
- name: Run tests
working-directory: ./validator
shell: bash
run: python -m pytest -v
- name: Install files (Git Bash)
shell: bash
run: make install
- name: Validate install
shell: bash
run: make verify
- name: Check sync
shell: bash
run: make sync
- name: Run validator checks
shell: bash
run: make check