name: "Python: Test and Lint" on: workflow_call: inputs: ref: required: true type: string secrets: CODECOV_TOKEN: required: false jobs: unit-test: name: Unit Tests - Python ${{ matrix.python-version }} - ${{ matrix.os-name }} permissions: contents: read strategy: matrix: include: # Linux - os: ubuntu-latest os-name: 'linux' python-version: "3.10" - os: ubuntu-latest os-name: 'linux' python-version: "3.11" - os: ubuntu-latest os-name: 'linux' python-version: "3.12" - os: ubuntu-latest os-name: 'linux' python-version: "3.13" - os: ubuntu-latest os-name: 'linux' python-version: "3.14" # Windows - os: windows-latest os-name: 'windows' python-version: "3.10" - os: windows-latest os-name: 'windows' python-version: "3.11" - os: windows-latest os-name: 'windows' python-version: "3.12" - os: windows-latest os-name: 'windows' python-version: "3.13" - os: windows-latest os-name: 'windows' python-version: "3.14" # MacOS - latest only; not enough runners for macOS - os: macos-latest os-name: 'macOS' python-version: "3.14" fail-fast: true runs-on: ${{ matrix.os }} env: LOG_LEVEL: DEBUG defaults: run: working-directory: strands-py steps: - name: Checkout code uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} persist-credentials: false - name: Set up Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install system audio dependencies (Linux) if: matrix.os-name == 'linux' working-directory: . run: | sudo apt-get update sudo apt-get install -y portaudio19-dev libasound2-dev - name: Install system audio dependencies (macOS) if: matrix.os-name == 'macOS' working-directory: . run: | brew install portaudio - name: Install system audio dependencies (Windows) if: matrix.os-name == 'windows' working-directory: . run: | # Windows typically has audio libraries available by default echo "Windows audio dependencies handled by PyAudio wheels" - name: Copy root LICENSE and NOTICE run: | cp ../LICENSE.APACHE LICENSE cp ../NOTICE . - name: Install dependencies run: | pip install --no-cache-dir hatch 'virtualenv<21' - name: Run Unit tests id: tests run: hatch test tests --cover continue-on-error: false - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} lint: name: Lint runs-on: ubuntu-latest permissions: contents: read defaults: run: working-directory: strands-py steps: - name: Checkout code uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} persist-credentials: false - name: Set up Python uses: actions/setup-python@v6 with: python-version: '3.10' cache: 'pip' - name: Install system audio dependencies (Linux) working-directory: . run: | sudo apt-get update sudo apt-get install -y portaudio19-dev libasound2-dev - name: Copy root LICENSE and NOTICE run: | cp ../LICENSE.APACHE LICENSE cp ../NOTICE . - name: Install dependencies run: | pip install --no-cache-dir hatch 'virtualenv<21' - name: Run lint id: lint run: hatch fmt --linter --check continue-on-error: false