name: Upload Coverage
description: Upload coverage files

runs:
  using: "composite"

  steps:
    - run: |
        COVERAGE_UUID=$(python3 -c "import uuid; print(uuid.uuid4())")
        echo "COVERAGE_UUID=${COVERAGE_UUID}" >> $GITHUB_OUTPUT
        if [ -f .coverage ]; then
          mv .coverage .coverage.${COVERAGE_UUID}
        fi
      id: coverage-uuid
      shell: bash
    - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
      with:
        name: coverage-data-${{ steps.coverage-uuid.outputs.COVERAGE_UUID }}
        path: |
          .coverage.*
          *.lcov
        if-no-files-found: ignore
        include-hidden-files: true
