build(flowdjs,flowmcp): bundle @flow/api into dist (keep it internal) #11
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: CI | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| web: | |
| name: Web (flowui · check · build) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # flowui bundles the flowcore wasm; generate the glue (gitignored) first, | |
| # natively for wasm32 — the same recipe as `npm run gen:wasm`, without Docker. | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Generate the wasm glue (web target) | |
| run: | | |
| cargo install wasm-bindgen-cli --version 0.2.127 --locked | |
| cargo build -p flowwasm --target wasm32-unknown-unknown --release | |
| wasm-bindgen --target web --out-dir flowwasm/pkg-web \ | |
| target/wasm32-unknown-unknown/release/flowwasm.wasm | |
| sh flowui/scripts/copy-wasm.sh | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type + Svelte check | |
| run: pnpm --filter flowui check | |
| - name: Test | |
| run: pnpm --filter flowui test | |
| - name: Build | |
| run: pnpm --filter flowui build | |
| go: | |
| name: Go TUI (flowcli · vet · test · build) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: flowcli/go.mod | |
| - name: Vet | |
| working-directory: flowcli | |
| run: go vet ./... | |
| - name: Test | |
| working-directory: flowcli | |
| run: go test ./... | |
| - name: Build | |
| working-directory: flowcli | |
| run: go build ./... | |
| core: | |
| name: Core (flowd · fmt · clippy · test) | |
| runs-on: ubuntu-latest | |
| # Native on Linux, where build scripts are not blocked (the local dev host | |
| # runs these in Docker via `npm run test:flowd`). Generated bindings are | |
| # checked in (flowd/src/generated), so no buf step is needed here. | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: flowd | |
| - name: Format | |
| working-directory: flowd | |
| run: cargo fmt --check | |
| - name: Clippy | |
| working-directory: flowd | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Test | |
| working-directory: flowd | |
| run: cargo test | |
| # Build the flowd binary once here; mcp-integration reuses it (no rebuild). | |
| # Strip debug symbols — the integration job only needs to RUN it (~15 MB, not ~120). | |
| - name: Build binary | |
| working-directory: flowd | |
| run: | | |
| cargo build --bin flowd | |
| strip target/debug/flowd | |
| - name: Upload flowd binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flowd-bin | |
| path: flowd/target/debug/flowd | |
| retention-days: 1 | |
| mcp: | |
| name: MCP (flowmcp · typecheck · test) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Typecheck | |
| run: pnpm --filter flowmcp typecheck | |
| - name: Test | |
| run: pnpm --filter flowmcp test | |
| mcp-integration: | |
| name: MCP (flowmcp · integration · real flowd) | |
| runs-on: ubuntu-latest | |
| needs: core # reuse the flowd binary built in `core` — no Rust toolchain here | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Download flowd binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: flowd-bin | |
| path: bin | |
| # Start the prebuilt flowd (seeded, in-memory) and wait for the gRPC port. | |
| - name: Start flowd | |
| run: | | |
| BIN="$(find bin -type f -name flowd | head -1)" | |
| test -n "$BIN" || { echo "flowd binary not found in artifact" >&2; exit 1; } | |
| chmod +x "$BIN" | |
| "$BIN" serve --addr 127.0.0.1:50051 --db :memory: --seed & | |
| for i in $(seq 1 30); do | |
| (echo > /dev/tcp/127.0.0.1/50051) 2>/dev/null && exit 0 | |
| sleep 1 | |
| done | |
| echo "flowd did not start" >&2; exit 1 | |
| - name: Integration smoke | |
| env: | |
| RUN_INTEGRATION: "1" | |
| FLOWD_ADDR: http://127.0.0.1:50051 | |
| run: pnpm --filter flowmcp test:integration |