Skip to content

chore(deps): update astral-sh/setup-uv digest to 37802ad #237

chore(deps): update astral-sh/setup-uv digest to 37802ad

chore(deps): update astral-sh/setup-uv digest to 37802ad #237

Workflow file for this run

name: Python SDK Tests
on:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
permissions:
pull-requests: write
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv
uses: astral-sh/setup-uv@e06108dd0aef18192324c70427afc47652e63a82 # v7
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
run: uv tool install hatch
- name: Install dependencies
working-directory: ./
run: |
uv pip install --system --editable .
uv pip install --system pytest pytest-cov anyio pytest-asyncio
- name: Run tests
working-directory: ./
run: |
hatch run test
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_OUTPUT
echo "COVERAGE_PCT=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(f'{float(root.attrib[\"line-rate\"]) * 100:.2f}')")" >> $GITHUB_OUTPUT
echo "TEST_COUNT=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(root.find('.//metrics').attrib['tests'])")" >> $GITHUB_OUTPUT
id: test_results
- name: Create result file
run: |
mkdir -p test-results
echo "${{ steps.test_results.outputs.COVERAGE_PCT }}" > test-results/coverage.txt
echo "${{ steps.test_results.outputs.TEST_COUNT }}" > test-results/test-count.txt
- name: Upload test results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: test-results-${{ matrix.python-version }}
path: test-results/