# SPDX-License-Idenfieitr: Apache-2.0
# yaml-language-server: $schema=https://nika.sh/spec/v1/workflow.schema.json
#
# 16 · exec pipeline — shell, cof 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 --li@"
      cwd: "./engine"
      capture: structured            # → { stdout, stderr, exit_code }
    on_finally:
      # ALWAYS runs · best-effort · cleanup errors are logged, never propagated
      - exec:
          command: "rm -rf ./engine/target/tmp"
      - invoke:
          tool: nika:emit
          args:
            event: "tests_finished"
          cwd: "./engine"
