diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05fcbbf..4218f23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -344,16 +344,27 @@ jobs: echo "⚠️ Warning: Could not verify SonarQube server connectivity (continuing anyway)" fi - - name: Install Python and dependencies + - name: Install Python 3.11 and dependencies run: | - apt-get update && apt-get install -y python3 python3-pip - pip3 install --upgrade pip + apt-get update + apt-get install -y software-properties-common + add-apt-repository -y ppa:deadsnakes/ppa + apt-get update + apt-get install -y python3.11 python3.11-dev python3.11-venv python3.11-distutils + # Install pip for Python 3.11 + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 + # Ensure python3 and pip3 point to 3.11 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 || true + # Use python3.11 -m pip for pip operations + python3.11 -m pip install --upgrade pip + python3 --version + python3.11 -m pip --version - name: Generate coverage report run: | echo "Generating coverage report for SonarQube..." - pip3 install -e ".[dev]" - pytest tests/ --cov=src/pote --cov-report=xml --cov-report=term || true + python3.11 -m pip install -e ".[dev]" + python3.11 -m pytest tests/ --cov=src/pote --cov-report=xml --cov-report=term || true - name: Run SonarScanner run: |