Skip to content

feat:#410 Implemeted multi python version suport #2

feat:#410 Implemeted multi python version suport

feat:#410 Implemeted multi python version suport #2

name: Multi-Python Version Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: "python-versions-${{ github.ref }}"
cancel-in-progress: true
jobs:
test-matrix:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
# All supported Python versions (3.10-3.13)
python-version: ["3.10", "3.11", "3.12", "3.13"]
experimental: [false]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
run: |
pip install --upgrade pip
pip install uv==0.5.30
- name: Install dependencies
run: |
uv sync
- name: Run tests (excluding integration)
run: |
uv run pytest tests/ --ignore=tests/integration --tb=short -v --cov=pyretailscience
env:
PYTHONDONTWRITEBYTECODE: 1
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
test-summary:
name: Multi-version test summary
runs-on: ubuntu-latest
needs: [test-matrix]
if: always()
steps:
- name: Check test matrix results
run: |
echo "Test matrix results: ${{ needs.test-matrix.result }}"
if [[ "${{ needs.test-matrix.result }}" == "failure" ]]; then
echo "Multi-version tests failed"
exit 1
fi
echo "Multi-version tests passed"