name: Benchmark

on:
#  push:
  workflow_dispatch:

jobs:
  ConfigParams:
    uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r7

  BenchmarkingParams:
    uses: pyTooling/Actions/.github/workflows/Parameters.yml@r7
    with:
      name: Benchmark
      python_version_list: "3.12 3.13 3.14 pypy-3.11"
      pipeline-delay: 240

  Benchmarking:
    uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r7
    needs:
      - ConfigParams
      - BenchmarkingParams
    with:
      jobs:                  ${{ needs.BenchmarkingParams.outputs.python_jobs }}
      requirements:          '-r tests/benchmark/requirements.txt'
      unittest_directory:    'benchmark'
      unittest_report_xml:   ${{ needs.ConfigParams.outputs.unittest_report_xml }}
      coverage_report_html:  ${{ needs.ConfigParams.outputs.coverage_report_html }}
      unittest_xml_artifact: 'pyTooling-BenchmarkTestReportSummary-XML'

  PublishTestResults:
    uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r7
    needs:
      - ConfigParams
      - Benchmarking
    with:
      testsuite-summary-name:     ${{ needs.ConfigParams.outputs.package_fullname }}
      unittest_artifacts_pattern: "*-BenchmarkTestReportSummary-XML-*"
      report_title:               'Benchmark Test Summary'
      merged_junit_artifact:      pyTooling-BenchmarkTestReportSummary-XML
      dorny:                      true
      codecov:                    true
      codecov_flags:              'benchmark'
    secrets: inherit
