diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 3a17ff6..f0458a2 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -80,19 +80,20 @@ jobs: run: | $ErrorActionPreference = 'Stop' - # python is provided by the host (machine-wide install in PATH). - # Requires Python >=3.11 per pyproject.toml. - $py = (Get-Command python -ErrorAction Stop).Source - Write-Host "Using python: $py" - & $py --version - if ($LASTEXITCODE -ne 0) { throw "python --version failed" } - - if (-not (Test-Path "$env:VENV_DIR\Scripts\python.exe")) { - Write-Host "Creating venv at $env:VENV_DIR" - & $py -m venv $env:VENV_DIR + # Production venv lives at F:\CI\python\venv (per AGENTS.md). + # If missing, bootstrap it via the Windows Python launcher (py -3.11), + # since the act_runner SYSTEM service does NOT have plain "python" in PATH. + $venvPy = Join-Path $env:VENV_DIR 'Scripts\python.exe' + if (-not (Test-Path $venvPy)) { + Write-Host "Venv missing, bootstrapping at $env:VENV_DIR" + $launcher = (Get-Command py.exe -ErrorAction Stop).Source + & $launcher -3.11 -m venv $env:VENV_DIR if ($LASTEXITCODE -ne 0) { throw "venv creation failed" } } - $venvPy = Join-Path $env:VENV_DIR 'Scripts\python.exe' + Write-Host "Using venv python: $venvPy" + & $venvPy --version + if ($LASTEXITCODE -ne 0) { throw "python --version failed" } + & $venvPy -m pip install --upgrade pip if ($LASTEXITCODE -ne 0) { throw "pip upgrade failed" } & $venvPy -m pip install -e ".[dev]" @@ -112,9 +113,9 @@ jobs: & $venvPy -m mypy --strict src if ($LASTEXITCODE -ne 0) { throw "mypy failed" } - - name: pytest (coverage >= 70%) + - name: pytest (coverage >= 80%) shell: powershell run: | $venvPy = Join-Path $env:VENV_DIR 'Scripts\python.exe' - & $venvPy -m pytest tests/python --cov=ci_orchestrator --cov-fail-under=70 + & $venvPy -m pytest tests/python --cov=ci_orchestrator --cov-fail-under=80 if ($LASTEXITCODE -ne 0) { throw "pytest failed" }