diff --git a/.github/workflows/reusable_codeql.yml b/.github/workflows/reusable_codeql.yml index e76456310..b57b993a8 100644 --- a/.github/workflows/reusable_codeql.yml +++ b/.github/workflows/reusable_codeql.yml @@ -34,7 +34,27 @@ jobs: with: fetch-depth: 0 - - name: Setup newer Python + - name: Check for Python >= 3.10 + id: check_python + run: | + echo "python_exists=false" >> $GITHUB_OUTPUT + $pythonCommand = Get-Command python -ErrorAction SilentlyContinue + if ($pythonCommand) { + $pythonVersion = python --version 2>&1 + $versionPattern = 'Python (\d+)\.(\d+)\.(\d+)' + echo $pythonVersion + if ($pythonVersion -match $versionPattern) { + $major = [int]$matches[1] + $minor = [int]$matches[2] + if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) { + echo "python_exists=true" >> $GITHUB_OUTPUT + } + } + } + shell: pwsh + + - name: Setup Python 3.10 + if: steps.check_python.outputs.python_exists == 'false' uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 with: python-version: "3.10" diff --git a/.github/workflows/reusable_fast.yml b/.github/workflows/reusable_fast.yml index e25de68a1..44c563195 100644 --- a/.github/workflows/reusable_fast.yml +++ b/.github/workflows/reusable_fast.yml @@ -62,6 +62,47 @@ jobs: with: fetch-depth: 0 + - name: Check for Python >= 3.10 + if: matrix.os == 'windows-latest' + id: check_python + run: | + echo "python_exists=false" >> $GITHUB_OUTPUT + $pythonCommand = Get-Command python -ErrorAction SilentlyContinue + echo $pythonCommand + $pythonCommand3 = Get-Command python3 -ErrorAction SilentlyContinue + echo $pythonCommand3 + echo $env:PATH + if ($pythonCommand) { + $pythonVersion = python --version 2>&1 + $versionPattern = 'Python (\d+)\.(\d+)\.(\d+)' + echo $pythonVersion + if ($pythonVersion -match $versionPattern) { + $major = [int]$matches[1] + $minor = [int]$matches[2] + if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) { + echo "python_exists=true" >> $GITHUB_OUTPUT + } + } + } + shell: pwsh + + - name: aaa + if: matrix.os == 'windows-latest' + run: | + echo "path: " + $env:PATH + $pythonCommand = Get-Command python -ErrorAction SilentlyContinue + echo "cmd: " + $pythonCommand + $pythonCommand3 = Get-Command python3 -ErrorAction SilentlyContinue + echo "cmd3: " + $pythonCommand3 + python3 -m pip install -r third_party/requirements.txt + shell: pwsh + + - name: aaa2 + if: matrix.os == 'windows-latest' + run: | + python3 -m pip install -r third_party/requirements.txt + shell: pwsh + - name: Initialize vcpkg if: matrix.os == 'windows-latest' uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5