name: prepare-gpu
description: 'Copy over GPU binaries to be used in simulation time to sims directory'

inputs:
  group-key:
    description: group key
    required: true
  prepare-script:
    description: prepare script to use
    required: false
    default: "copy-gpu-binaries.sh"
  toolchain:
    description: toolchain to use
    required: false
    default: "riscv-tools"

runs:
  using: "composite"
  steps:
    - name: Init submodules to ensure stimuli is located
      run: |
        conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-${{ inputs.toolchain }}
        echo "Running init-submodules...sh in $PWD"
        ./scripts/init-submodules-no-riscv-tools.sh --force
      shell: bash -leo pipefail {0}

    - name: Copy binaries from rocket-gpu
      run: |
        ./.github/scripts/${{ inputs.prepare-script }}
      shell: bash -leo pipefail {0}
