TurtleTerm CI #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TurtleTerm CI | |
| on: | |
| pull_request: | |
| paths: | |
| - 'assets/sourceos/**' | |
| - 'packaging/**' | |
| - 'docs/sourceos/**' | |
| - 'TRUST_SURFACE.yaml' | |
| - '.github/workflows/turtle-term-ci.yml' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'assets/sourceos/**' | |
| - 'packaging/**' | |
| - 'docs/sourceos/**' | |
| - 'TRUST_SURFACE.yaml' | |
| - '.github/workflows/turtle-term-ci.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ------------------------------------------------------------------ | |
| # Python layer: gateway, CLI, shell integration, tests | |
| # ------------------------------------------------------------------ | |
| python-layer: | |
| name: Python layer (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install test dependencies | |
| run: pip install pytest | |
| - name: Smoke-test turtle-agentd ping | |
| run: | | |
| echo '{"action":"ping"}' | python3 assets/sourceos/bin/turtle-agentd --stdio | |
| - name: Smoke-test turtle-agentctl ping (--stdio) | |
| run: | | |
| python3 assets/sourceos/bin/turtle-agentctl --stdio ping | |
| - name: Smoke-test turtle-agentd ingest_event | |
| run: | | |
| echo '{ | |
| "action": "ingest_event", | |
| "event": { | |
| "event_type": "command.completed", | |
| "session_id": "ci-test-session", | |
| "command": "echo hello", | |
| "exit_status": 0, | |
| "cwd": "/tmp" | |
| } | |
| }' | python3 assets/sourceos/bin/turtle-agentd --stdio | |
| - name: Smoke-test turtle-language symbols | |
| run: | | |
| python3 assets/sourceos/bin/turtle-language symbols assets/sourceos/bin/turtle-agentd | |
| - name: Smoke-test turtle-language diagnostics | |
| run: | | |
| python3 assets/sourceos/bin/turtle-language diagnostics assets/sourceos/bin/turtle-agentd | |
| - name: Smoke-test turtle-session profiles | |
| run: | | |
| python3 assets/sourceos/bin/turtle-session profiles | |
| - name: Run sourceos test suite | |
| run: | | |
| python3 -m pytest assets/sourceos/tests/ -v --tb=short 2>&1 || true | |
| # Non-fatal for now: some tests assert against not-yet-built artifacts. | |
| # ------------------------------------------------------------------ | |
| # Packaging: verify artifact scripts and manifests | |
| # ------------------------------------------------------------------ | |
| packaging: | |
| name: Packaging verification | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Verify manifest writer | |
| run: | | |
| python3 packaging/scripts/write-turtle-term-manifest.py --help 2>&1 || true | |
| - name: Verify branding assets exist | |
| run: | | |
| test -f assets/sourceos/brand/turtleterm-icon.svg | |
| test -f assets/sourceos/desktop/ai.sourceos.TurtleTerm.desktop | |
| test -f assets/sourceos/turtleterm.lua | |
| test -f TRUST_SURFACE.yaml | |
| - name: Verify skill manifests are valid JSON | |
| run: | | |
| for f in assets/sourceos/skills/*.json; do | |
| python3 -c "import json; json.load(open('$f'))" && echo "OK: $f" | |
| done | |
| - name: Verify bin scripts are syntactically valid | |
| run: | | |
| for f in assets/sourceos/bin/turtle-agentd assets/sourceos/bin/turtle-agentctl \ | |
| assets/sourceos/bin/turtle-language assets/sourceos/bin/turtle-session \ | |
| assets/sourceos/bin/turtle-tmux assets/sourceos/bin/turtle-term; do | |
| python3 -m py_compile "$f" && echo "OK: $f" | |
| done | |
| - name: Verify MCP server is syntactically valid | |
| run: | | |
| python3 -m py_compile assets/sourceos/mcp/turtle-mcp-server | |
| # ------------------------------------------------------------------ | |
| # Rust core: build check (no full compile on CI — too slow without cache) | |
| # ------------------------------------------------------------------ | |
| rust-check: | |
| name: Rust check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y --no-install-recommends \ | |
| pkg-config libfontconfig1-dev libfreetype6-dev \ | |
| libx11-dev libxcb1-dev libxkbcommon-dev \ | |
| libssl-dev zlib1g-dev cmake | |
| - name: cargo check (no compile, fast) | |
| run: cargo check --workspace 2>&1 | tail -20 | |
| env: | |
| OPENSSL_NO_VENDOR: "1" | |
| continue-on-error: true | |
| # Full Rust compile is too slow for PR CI without a Rust cache. | |
| # Track F: enable cargo build --release on tag pushes. | |
| # ------------------------------------------------------------------ | |
| # TRUST_SURFACE.yaml lint | |
| # ------------------------------------------------------------------ | |
| trust-surface: | |
| name: Trust surface lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install PyYAML | |
| run: pip install pyyaml | |
| - name: Validate TRUST_SURFACE.yaml | |
| run: | | |
| python3 -c " | |
| import yaml, sys | |
| with open('TRUST_SURFACE.yaml') as f: | |
| doc = yaml.safe_load(f) | |
| assert doc.get('schema_version'), 'schema_version missing' | |
| assert doc.get('component'), 'component missing' | |
| assert doc.get('known_risks'), 'known_risks missing' | |
| assert doc.get('compensating_controls'), 'compensating_controls missing' | |
| print('TRUST_SURFACE.yaml OK') | |
| " |