name: "Tests execution"
description: "Running tests"
inputs:
  runtime:
    description: "Runtime to use for running test"
    required: true
  model-kind:
    description: "Running against CI baked or production model"
    required: true
  samplerate:
    description: "Sample rate for testing"
    required: true
  chroot:
    description: "Run using a chroot"
    required: false
runs:
  using: "composite"
  steps:
    - run: |
        set -xe

        build="_tflite"

        model_kind=""
        if [ "${{ inputs.model-kind }}" = "prod" ]; then
          model_kind="-prod"
        fi

        prefix="."
        if [ ! -z "${{ inputs.chroot }}" ]; then
          prefix="${{ inputs.chroot }}"
        fi

        ${prefix}/ci_scripts/${{ inputs.runtime }}${build}-tests${model_kind}.sh ${{ inputs.samplerate }}
      shell: bash
