Use the signing host's own Python rather than actions/setup-python

The first run on the self-hosted runner hung on setup-python for thirty
minutes, against eleven seconds for setup-node, and had to be cancelled. On
Windows that action installs Python rather than unpacking it, and anything
raising a UAC prompt in the auto-logged-in session waits forever with nobody to
answer it. Which is the PIN dialog problem wearing different clothes, and worth
remembering as a property of this machine: anything that might prompt will hang
rather than fail.

The machine has a Python already, which is what the buildfarm's Jenkins job
uses, so the workflow finds it on PATH and derives PGADMIN_PYTHON_DIR from
that. It is also closer to what we are actually testing here, since the point
of building on this box rather than a hosted runner is to exercise its
environment.

virtualenv is checked rather than installed, consistent with the other
prerequisites: a CI job should not be modifying the one machine in the pipeline
that cannot be rebuilt, so it stops with the command to run instead.
This commit is contained in:
Dave Page committed 2026-09-16 12:57:57 +01:00
1 parent b6ed164952
commit 5dcf165a0a
1 file changed
+24 -10
+24 -10
View File
@@ -60,13 +60,31 @@ jobs:
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-python@v7
id: python
with:
python-version: '3.13'
# Deliberately not actions/setup-python. On this runner it hangs
# indefinitely: it installs Python rather than unpacking it, and anything
# that raises a UAC prompt in the auto-logged-in session waits forever
# with nobody to answer it, exactly as the card's PIN dialog would. The
# first attempt sat on that step for thirty minutes against eleven
# seconds for setup-node.
#
# The machine has a Python already, which is what the buildfarm's Jenkins
# job uses, and using it is closer to what we are actually testing here
# anyway.
- name: Locate Python
shell: pwsh
run: |
$python = Get-Command python -ErrorAction SilentlyContinue
if (-not $python) { throw "No python on PATH on this runner." }
$pythonDir = Split-Path $python.Source -Parent
Write-Output "Python: $pythonDir"
& $python.Source --version
- name: Install virtualenv
run: python -m pip install --upgrade pip virtualenv
if (-not (Test-Path (Join-Path $pythonDir 'Scripts\virtualenv.exe'))) {
throw ("virtualenv is not installed for this Python, and Make.bat requires it. " +
"Install with: python -m pip install virtualenv")
}
"PGADMIN_PYTHON_DIR=$pythonDir" | Out-File -FilePath $env:GITHUB_ENV -Append
# Unlike the hosted build, nothing is installed here. This machine is
# configured by hand rather than by Ansible, it is the only one in the
@@ -149,7 +167,6 @@ jobs:
- name: Build the signed installer
shell: cmd
env:
PGADMIN_PYTHON_DIR: ${{ format('{0}', steps.python.outputs.python-path) }}
PGADMIN_WINDOWS_CSC: ${{ vars.PGADMIN_WINDOWS_CSC }}
run: |
IF "%PGADMIN_WINDOWS_CSC%" == "" (
@@ -158,9 +175,6 @@ jobs:
EXIT /b 1
)
FOR %%I IN ("%PGADMIN_PYTHON_DIR%") DO SET "PGADMIN_PYTHON_DIR=%%~dpI"
IF "%PGADMIN_PYTHON_DIR:~-1%" == "\" SET "PGADMIN_PYTHON_DIR=%PGADMIN_PYTHON_DIR:~0,-1%"
SET "PGADMIN_POSTGRES_DIR=%DEPS_DIR%\postgresql"
SET "PGADMIN_KRB5_DIR=%DEPS_DIR%\krb5"
SET "PGADMIN_INNOTOOL_DIR=C:\Program Files (x86)\Inno Setup 6"