### ----------------------------------------------------
### -- App::Workflows::Github
### -- Licenses: Artistic-2.0
### -- Authors: rcmlz
### -- File: resources/dispatch.tmpl.yml
### ----------------------------------------------------
# save as .github/workflows/dispatch.yml
# run on Terminal: gh workflow run 'dispatch' --ref branch-name -f verbosity=debug -f os=windows
name: dispatch

on:
  workflow_dispatch:
    inputs:
      os:
        description: Operating System to run on
        required: true
        default: ubuntu
        type: choice
        options: 
        - ubuntu
        - macos
        - windows
      os_version:
        description: OS version
        required: true
        default: latest
        type: string
      raku_version:
        description: Raku version
        required: true
        default: latest
        type: string
      verbosity:
        description: zef verbosity
        required: true
        default: verbose
        type: choice
        options: 
        - error
        - warn
        - info
        - verbose
        - debug
      ad_hoc_pre_command:
        description: ad-hoc-pre command
        required: false
        type: string
      ad_hoc_post_command:
        description: ad-hoc-post command
        required: false
        type: string
      skip_deps_tests:
        description: skip dependency tests
        required: true
        default: false
        type: boolean
      install_module:
        description: install module
        required: true
        default: true
        type: boolean
      run_prove6:
        description: run prove6
        required: true
        default: false
        type: boolean
      run_tests_script:
        description: run-tests.raku
        required: true
        default: false
        type: boolean

jobs:
  launch:
    uses: ./.github/workflows/runner.yml
    with:
      os: ${{ inputs.os }}
      os_version: ${{ inputs.os_version }}
      raku_version: ${{ inputs.raku_version }}
      verbosity: ${{ inputs.verbosity }}
      skip_deps_tests: ${{ inputs.skip_deps_tests }}
      run_prove6: ${{ inputs.run_prove6 }}
      install_module: ${{ inputs.install_module }}
      run_tests_script: ${{ inputs.run_tests_script }}
      ad_hoc_pre_command: ${{ inputs.ad_hoc_pre_command }}
      ad_hoc_post_command: ${{ inputs.ad_hoc_post_command }}


