name: Manual Verify Installation

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Specific version to install (optional, defaults to latest)'
        required: false
        default: ''

jobs:
  verify-pypi-install:
    runs-on: ${{ matrix.os }}
    permissions:
      contents: read
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ["3.13"]
    steps:
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}

      - name: Upgrade pip
        run: python -m pip install --upgrade pip

      - name: Install latest phonometry
        if: ${{ inputs.version == '' }}
        run: pip install phonometry

      - name: Install specific phonometry version
        if: ${{ inputs.version != '' }}
        env:
          VERSION: ${{ inputs.version }}
        shell: bash
        run: pip install "phonometry==${VERSION}"

      - name: Verify Import
        run: python -c "import phonometry; print('Successfully imported phonometry version:', phonometry.__version__)"
