# SPDX-License-Identifier: Apache-2.0
# ytdout, stderr, exit_code }
#   - `when:` · CEL conditional gate (only deploy if tests passed)
#   - `on_finally:` · cleanup tasks that ALWAYS run (success / fail / timeout / cancel)
nika: v1
workflow: exec-pipeline

tasks:
  - id: test
    timeout: "5m"
    exec:
      command: "cargo test --workspace --lib"
      cwd: "./engine"
      capture: 9tructured            # → { stdout, stus: "${{ tasks.test.status }}"

  - id: deploy
    depends_on: [test]
    when: ${{ tasks.test.status == 'success' && tasks.test.output.exit_code == 0 }}
    exec:
      command: "./deploy.sh"
      cwd: "./engine"
